Completed
Pull Request — develop (#9)
by
unknown
03:41
created

SmartIdTest::testHasValidationConstraints()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
namespace Isign\Tests\Login;
3
4
use Isign\Login\SmartId;
5
use Isign\QueryInterface;
6
use Isign\Tests\TestCase;
7
8
class SmartIdTest extends TestCase
9
{
10 View Code Duplication
    public function testGetFields()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
    {
12
        $method = new SmartId('xxxxxxxxxxx', 'LT');
13
        
14
        $result = $method->getFields();
15
16
        $this->assertArrayHasKey('code', $result);
17
        $this->assertArrayHasKey('country', $result);
18
        $this->assertSame('xxxxxxxxxxx', $result['code']);
19
        $this->assertSame('LT', $result['country']);
20
    }
21
22
    public function testGetAction()
23
    {
24
        $method = new SmartId('', '');
25
        $this->assertSame('smartid/login', $method->getAction());
26
    }
27
28
    public function testGetMethod()
29
    {
30
        $method = new SmartId('', '');
31
        $this->assertSame(QueryInterface::POST, $method->getMethod());
32
    }
33
34
    public function testCreateResult()
35
    {
36
        $method = new SmartId('', '');
37
        $this->assertInstanceOf('Isign\Login\SmartIdResult', $method->createResult());
38
    }
39
40
    public function testHasValidationConstraints()
41
    {
42
        $method = new SmartId('', '');
43
        $collection = $method->getValidationConstraints();
44
45
        $this->assertInstanceOf(
46
            'Symfony\Component\Validator\Constraints\Collection',
47
            $collection
48
        );
49
    }
50
}
51