Completed
Pull Request — master (#11)
by Eugene
45:13
created

AzineContactSorterTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCompare() 0 11 1
1
<?php
2
3
namespace Azine\HybridAuthBundle\Tests\Services;
4
5
use Azine\HybridAuthBundle\Entity\UserContact;
6
use Azine\HybridAuthBundle\Services\AzineContactSorter;
7
use Azine\HybridAuthBundle\Tests\AzineTestCase;
8
9
class AzineContactSorterTest extends AzineTestCase
10
{
11
    public function testCompare()
12
    {
13
        $u1 = new UserContact('Xing', 'm', 'firstname', 'lasTname');
14
        $u2 = new UserContact('Xing', 'm', 'firstname2', 'lastname2');
15
        $u3 = new UserContact('Xing', 'm', 'firstname3', 'Lastname3');
16
17
        $sorter = new AzineContactSorter();
18
        $this->assertSame(0, $sorter->compare($u1, $u1));
19
        $this->assertSame(-1, $sorter->compare($u1, $u2));
20
        $this->assertSame(1, $sorter->compare($u3, $u2));
21
    }
22
}
23