testBootKernel_WithConfigWithoutProjectionManagerFactory_ShouldThrowBadConfigurationException()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php declare(strict_types = 1);
2
3
namespace TomCizek\SymfonyProoph\Tests\ProjectionManager;
4
5
use Prooph\EventStore\Pdo\Projection\MySqlProjectionManager;
6
use Prooph\EventStore\Projection\ProjectionManager;
7
use TomCizek\SymfonyProoph\BadConfigurationException;
8
use TomCizek\SymfonyProoph\Tests\Configurators\ProophTestCase;
9
10
class MysqlProjectionManagerConfiguratorTest extends ProophTestCase
11
{
12
	private const FIXTURE_CONFIG_FILE = 'ProjectionManagerTests/MysqlProjectionManagerTest.yml';
13
	private const FIXTURE_CONFIG_FILE_WITHOUT_FACTORY = 'Invalid//MysqlProjectionManagerWithoutFactoryTest.yml';
14
15
	public function testGetProjectionManagerByType_FromTestContainer_ShouldReturnExpectedInstance()
16
	{
17
		$this->givenContainerWithLoadedBundlesWithGivenConfig(self::FIXTURE_CONFIG_FILE);
18
19
		$manager = $this->whenGetFromContainer(ProjectionManager::class);
20
21
		$this->thenIsInstanceOfGivenClass(MySqlProjectionManager::class, $manager);
22
	}
23
24
	public function testBootKernel_WithConfigWithoutProjectionManagerFactory_ShouldThrowBadConfigurationException()
25
	{
26
		$this->willThrowException(BadConfigurationException::class);
27
28
		$this->whenBootKernelWithConfig(self::FIXTURE_CONFIG_FILE_WITHOUT_FACTORY);
29
	}
30
}
31