AllowedCommandTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 22
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldConstraintBeAppliedOnProperty() 0 6 1
A shouldReturnTheServiceUsedForValidation() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the AMFConsoleBundle.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Tests\Validator\Constraints;
11
12
use AMF\ConsoleBundle\Validator\Constraints\AllowedCommand;
13
14
/**
15
 * Test cases for allowed command contstraint.
16
 *
17
 * @author Amine Fattouch <[email protected]>
18
 */
19
class AllowedCommandTest extends \PHPUnit_Framework_TestCase
20
{
21
    /**
22
     * @test
23
     */
24
    public function shouldConstraintBeAppliedOnProperty()
25
    {
26
        $allowedCommand = \Phake::partialMock(AllowedCommand::class);
27
28
        $this->assertEquals('property', $allowedCommand->getTargets());
0 ignored issues
show
Bug introduced by
The method getTargets() does not seem to exist on object<Phake_IMock>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
29
    }
30
31
    /**
32
     * @test
33
     */
34
    public function shouldReturnTheServiceUsedForValidation()
35
    {
36
        $allowedCommand = \Phake::partialMock(AllowedCommand::class);
37
38
        $this->assertEquals('validator.allowed_command', $allowedCommand->validatedBy());
0 ignored issues
show
Bug introduced by
The method validatedBy() does not seem to exist on object<Phake_IMock>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
39
    }
40
}
41