Completed
Pull Request — master (#28)
by Jáchym
05:05 queued 03:02
created

AbstractEventSubscriberTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getConfigFiles() 0 7 1
A setUp() 0 6 1
1
<?php
2
3
namespace Zenify\DoctrineMigrations\Tests\EventSubscriber;
4
5
use Nette\DI\Container;
6
use PHPUnit_Framework_TestCase;
7
use Symfony\Component\Console\Application;
8
use Zenify\DoctrineMigrations\Tests\ContainerFactory;
9
10
11
abstract class AbstractEventSubscriberTest extends PHPUnit_Framework_TestCase
12
{
13
14
	/**
15
	 * @var array
16
	 */
17
	private $data;
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
18
19
	/**
20
	 * @var Container
21
	 */
22
	protected $container;
23
24
	/**
25
	 * @var Application
26
	 */
27
	protected $application;
28
29
30
	/**
31
	 * @param string $name
32
	 * @param array $data
33
	 * @param string $dataName
34
	 */
35
	public function __construct($name = NULL, array $data = [], $dataName = '')
36
	{
37
		parent::__construct($name, $data, $dataName);
38
39
		$this->data = $data;
40
	}
41
42
43
	/**
44
	 * Data provider for all tests.
45
	 *
46
	 * @return string[]
47
	 */
48
	public function getConfigFiles()
49
	{
50
		return [
51
			[__DIR__ . '/../config/default.neon'],
52
			[__DIR__ . '/../config/symnedi.neon'],
53
		];
54
	}
55
56
57
	protected function setUp()
58
	{
59
		$container = (new ContainerFactory)->createWithConfig($this->data);
60
		$this->container = $container;
61
		$this->application = $container->getByType(Application::class);
62
	}
63
64
}
65