GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 0165b3...f3e283 )
by Bruno
13:51
created

testDefaultConfiguration()   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
namespace OnurbTest\Bundle\YumlBundle\DependencyInjection;
3
4
use Onurb\Bundle\YumlBundle\DependencyInjection\OnurbYumlExtension;
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Loader;
8
9
abstract class AbstractOnurbYumlExtensionTest extends \PHPUnit_Framework_TestCase
10
{
11
    /**
12
     * @var OnurbYumlExtension
13
     */
14
    private $extension;
15
16
    /**
17
     * @var ContainerBuilder
18
     */
19
    private $container;
20
21
    protected function setUp()
22
    {
23
        $this->extension = new OnurbYumlExtension();
24
        $this->container = new ContainerBuilder();
25
26
        $this->container->registerExtension($this->extension);
27
28
        $loader = new Loader\YamlFileLoader($this->container, new FileLocator(__DIR__ . '/Fixtures/'));
29
        $loader->load('fake_doctrine_service.yml');
30
    }
31
32
    abstract protected function loadConfiguration(ContainerBuilder $container, $resource);
33
34
    public function testDefaultConfiguration()
35
    {
36
        $this->container->loadFromExtension($this->extension->getAlias());
37
        $this->container->compile();
38
39
        $this->assertFalse($this->container->has('onurb_yuml'));
40
    }
41
42
    public function testDefaultParams()
43
    {
44
        $this->container->loadFromExtension($this->extension->getAlias());
45
        $this->container->compile();
46
47
        $this->assertFalse($this->container->getParameter('onurb_yuml.show_fields_description'));
48
49
        $this->assertSame(array(), $this->container->getParameter('onurb_yuml.colors'));
50
        $this->assertSame(array(), $this->container->getParameter('onurb_yuml.notes'));
51
52
    }
53
54
    public function testTrueConfiguration()
55
    {
56
        $this->container->loadFromExtension($this->extension->getAlias());
57
        $this->loadConfiguration($this->container, 'config_true');
58
        $this->container->compile();
59
60
        $this->assertTrue($this->container->getParameter('onurb_yuml.show_fields_description'));
61
        $this->assertSame(array(), $this->container->getParameter('onurb_yuml.colors'));
62
        $this->assertSame(array(), $this->container->getParameter('onurb_yuml.notes'));
63
    }
64
65
    public function testPartialConfiguration()
66
    {
67
        $this->container->loadFromExtension($this->extension->getAlias());
68
69
        $this->loadConfiguration($this->container, 'config_partial');
70
        $this->container->compile();
71
72
        $this->assertTrue($this->container->getParameter('onurb_yuml.show_fields_description'));
73
        $this->assertSame(array(), $this->container->getParameter('onurb_yuml.colors'));
74
        $this->assertSame(array(), $this->container->getParameter('onurb_yuml.notes'));
75
    }
76
77
    public function testArrayColorsConfiguration()
78
    {
79
        $this->container->loadFromExtension($this->extension->getAlias());
80
81
        $this->loadConfiguration($this->container, 'config_colors');
82
        $this->container->compile();
83
84
        $this->assertSame(
85
            array(
86
                'My\Class' => 'green',
87
                'My\OtherClass' => 'blue'
88
            ),
89
            $this->container->getParameter('onurb_yuml.colors')
90
        );
91
    }
92
    public function testArrayNotesConfiguration()
93
    {
94
        $this->container->loadFromExtension($this->extension->getAlias());
95
96
        $this->loadConfiguration($this->container, 'config_notes');
97
        $this->container->compile();
98
99
        $this->assertSame(
100
            array(
101
                'My\Class' => 'My note',
102
                'My\OtherClass' => 'My other note'
103
            ),
104
            $this->container->getParameter('onurb_yuml.notes')
105
        );
106
    }
107
}
108