AzineContactSorterTest::testCompare()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 7
c 2
b 0
f 1
dl 0
loc 10
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Azine\HybridAuthBundle\Services;
4
5
use Azine\HybridAuthBundle\Entity\UserContact;
6
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
7
8
class AzineContactSorterTest extends TestCase
9
{
10
    public function testCompare()
11
    {
12
        $u1 = new UserContact('Xing', 'm', 'firstname', 'lasTname');
13
        $u2 = new UserContact('Xing', 'm', 'firstname2', 'lastname2');
14
        $u3 = new UserContact('Xing', 'm', 'firstname3', 'Lastname3');
15
16
        $sorter = new AzineContactSorter();
17
        $this->assertSame(0, $sorter->compare($u1, $u1));
18
        $this->assertSame(-1, $sorter->compare($u1, $u2));
19
        $this->assertSame(1, $sorter->compare($u3, $u2));
20
    }
21
}
22