Completed
Push — master ( dcf43c...59d132 )
by Tijs
06:54
created

ConfigureMenuEventTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace SumoCoders\FrameworkCoreBundle\Tests\Event;
4
5
use SumoCoders\FrameworkCoreBundle\Event\ConfigureMenuEvent;
6
7
class ConfigureMenuEventTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @var ConfigureMenuEvent
11
     */
12
    protected $configureMenuEvent;
13
14
    /**
15
     * @inherit
16
     */
17
    protected function setUp()
18
    {
19
        $this->configureMenuEvent = new ConfigureMenuEvent(
20
            $this->getFactory(),
21
            $this->getItem()
22
        );
23
    }
24
25
    /**
26
     * @return \PHPUnit_Framework_MockObject_MockObject
27
     */
28
    protected function getFactory()
29
    {
30
        $factory = $this->getMock('Knp\Menu\FactoryInterface');
31
32
        return $factory;
33
    }
34
35
    /**
36
     * @return \PHPUnit_Framework_MockObject_MockObject
37
     */
38
    protected function getItem()
39
    {
40
        $item = $this->getMock('Knp\Menu\ItemInterface');
41
42
        return $item;
43
    }
44
45
    /**
46
     * @inherit
47
     */
48
    protected function tearDown()
49
    {
50
        $this->configureMenuEvent = null;
51
    }
52
53
    /**
54
     * Test FrameworkExtension->getName()
55
     */
56
    public function testName()
57
    {
58
        $this->assertEquals('framework_core.configure_menu', ConfigureMenuEvent::EVENT_NAME);
59
    }
60
61
    /**
62
     * Test the getters and setters
63
     */
64
    public function testGettersAndSetters()
65
    {
66
        $this->assertEquals($this->getFactory(), $this->configureMenuEvent->getFactory());
67
        $this->assertEquals($this->getItem(), $this->configureMenuEvent->getMenu());
68
    }
69
}
70