MysqlProjectionManagerConfiguratorTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetProjectionManagerByType_FromTestContainer_ShouldReturnExpectedInstance() 0 8 1
A testBootKernel_WithConfigWithoutProjectionManagerFactory_ShouldThrowBadConfigurationException() 0 6 1
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