NotifierExtensionTest::testGetName()   A
last analyzed

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\FrameworkErrorBundle\Test\Twig\NotifierExtension;
4
5
use SumoCoders\FrameworkErrorBundle\Twig\NotifierExtension;
6
7
class NotifierExtensionTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @var NotifierExtension
11
     */
12
    protected $extension;
13
14
    public function setUp()
15
    {
16
        $this->extension = new NotifierExtension(
17
            $this->getTemplating(),
18
            'host',
19
            'api_key'
20
        );
21
    }
22
23
    /**
24
     * @return \PHPUnit_Framework_MockObject_MockObject
25
     */
26
    public function getTemplating()
27
    {
28
        $templating = $this->getMockBuilder('\Twig_Environment')
29
            ->disableOriginalConstructor()
30
            ->getMock();
31
        $templating->method('render');
32
33
        return $templating;
34
    }
35
36
    /**
37
     * Tests NotifierExtension::getFunctions()
38
     */
39
    public function testGetFunctions()
40
    {
41
        $var = $this->extension->getFunctions();
42
43
        $this->assertInternalType('array', $var);
44
        $this->assertInstanceOf(
45
            '\Twig_SimpleFunction',
46
            $var[0]
47
        );
48
    }
49
50
    /**
51
     * Tests NotifierExtension::getName()
52
     */
53
    public function testGetName()
54
    {
55
        $this->assertEquals(
56
            'errbit_notifier_extension',
57
            $this->extension->getName()
58
        );
59
    }
60
}
61