BundleInitializationTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getBundleClass() 0 4 1
A testRegisterBundle() 0 15 1
1
<?php
2
3
/*
4
 * This file is part of the PHP Translation package.
5
 *
6
 * (c) PHP Translation team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Translation\PlatformAdapter\PhraseApp\Tests\Functional;
13
14
use Http\HttplugBundle\HttplugBundle;
15
use Nyholm\BundleTest\BaseBundleTestCase;
16
use Translation\PlatformAdapter\PhraseApp\Bridge\Symfony\TranslationAdapterPhraseAppBundle;
17
use Translation\PlatformAdapter\PhraseApp\PhraseApp;
18
19
class BundleInitializationTest extends BaseBundleTestCase
20
{
21
    protected function getBundleClass()
22
    {
23
        return TranslationAdapterPhraseAppBundle::class;
24
    }
25
26
    public function testRegisterBundle()
27
    {
28
        $kernel = $this->createKernel();
29
        $kernel->addBundle(HttplugBundle::class);
30
31
        // Add some configuration
32
        $kernel->addConfigFile(__DIR__.'/config/default.yml');
33
34
        $this->bootKernel();
35
        $container = $this->getContainer();
36
37
        $this->assertTrue($container->has('php_translation.adapter.phrase_app'));
38
        $service = $container->get('php_translation.adapter.phrase_app');
39
        $this->assertInstanceOf(PhraseApp::class, $service);
40
    }
41
}
42