SymfonyInteropContainerExtensionTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testLoad_WithBundle_ShouldContainSymfonyInteropContainer() 0 6 1
A whenBuildContainerWith() 0 4 1
A thenContainsSymfonyInteropContainer() 0 7 1
1
<?php declare(strict_types = 1);
2
3
namespace TomCizek\SymfonyInteropContainer\Tests;
4
5
use Symfony\Component\DependencyInjection\ContainerInterface;
6
use TomCizek\SymfonyInteropContainer\SymfonyInteropContainer;
7
use TomCizek\SymfonyInteropContainer\SymfonyInteropContainerBundle;
8
use TomCizek\SymfonyInteropContainer\Tests\Configurators\ConfigFile;
9
use TomCizek\SymfonyInteropContainer\Tests\Configurators\SymfonyInteropContainerTestCase;
10
11
class SymfonyInteropContainerExtensionTest extends SymfonyInteropContainerTestCase
12
{
13
	/** @var ContainerInterface */
14
	protected $container;
15
16
	public function testLoad_WithBundle_ShouldContainSymfonyInteropContainer()
17
	{
18
		$this->whenBuildContainerWith([SymfonyInteropContainerBundle::class]);
19
20
		$this->thenContainsSymfonyInteropContainer();
21
	}
22
23
	/**
24
	 * @param string[]     $bundles
25
	 * @param ConfigFile[] $configFiles
26
	 *
27
	 * @return void
28
	 */
29
	private function whenBuildContainerWith(array $bundles = [], array $configFiles = []): void
30
	{
31
		$this->container = $this->getContainerFromBootedKernelWith($bundles, $configFiles);
32
	}
33
34
	private function thenContainsSymfonyInteropContainer()
35
	{
36
		$interopContainer = $this->container->get('interop_container');
37
		self::assertInstanceOf(SymfonyInteropContainer::class, $interopContainer);
38
		$interopContainer = $this->container->get(SymfonyInteropContainer::class);
39
		self::assertInstanceOf(SymfonyInteropContainer::class, $interopContainer);
40
	}
41
}
42