Failed Conditions
Push — issue#763 ( 4f5bf6 )
by Guilherme
08:27
created

EvaluateBadgesEventTest::testEvent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the login-cidadao project or it's bundles.
4
 *
5
 * (c) Guilherme Donato <guilhermednt on github>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace LoginCidadao\BadgesControlBundle\Tests\Event;
12
13
use LoginCidadao\BadgesControlBundle\Event\EvaluateBadgesEvent;
14
use LoginCidadao\CoreBundle\Entity\Person;
15
16
class EvaluateBadgesEventTest extends \PHPUnit_Framework_TestCase
17
{
18
    public function testEvent()
19
    {
20
        $person = new Person();
21
        $this->assertEmpty($person->getBadges());
22
23
        $badge1 = $this->getMock('LoginCidadao\BadgesControlBundle\Model\BadgeInterface');
24
        $badge2 = $this->getMock('LoginCidadao\BadgesControlBundle\Model\BadgeInterface');
25
26
        $event = new EvaluateBadgesEvent($person);
27
        $event->registerBadges([$badge1, $badge2]);
28
29
        $this->assertSame($person, $event->getPerson());
30
        $this->assertCount(2, $person->getBadges());
31
    }
32
}
33