AbstractAsynchronousMessageProducerFactoryTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 25
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testCallStatic_WithoutInteropContainer_ShouldThrowInvalidArgumentException() 0 6 1
A willFailWith() 0 4 1
A whenCallStaticWithoutInteropContainer() 0 5 1
A getFactoryClass() 0 4 1
1
<?php declare(strict_types = 1);
2
3
namespace TomCizek\SymfonyProoph\Tests\AsynchronousMessages;
4
5
use InvalidArgumentException;
6
use PHPUnit\Framework\TestCase;
7
use TomCizek\SymfonyProoph\AsynchronousMessages\Factories\AbstractAsynchronousMessageProducerFactory;
8
9
class AbstractAsynchronousMessageProducerFactoryTest extends TestCase
10
{
11
	public function testCallStatic_WithoutInteropContainer_ShouldThrowInvalidArgumentException()
12
	{
13
		$this->willFailWith(InvalidArgumentException::class);
14
15
		$this->whenCallStaticWithoutInteropContainer();
16
	}
17
18
	private function willFailWith(string $class)
19
	{
20
		$this->expectException($class);
21
	}
22
23
	private function whenCallStaticWithoutInteropContainer(): void
24
	{
25
		$factoryClass = $this->getFactoryClass();
26
		$factoryClass::callStaticWithoutInteropContainerArgument();
27
	}
28
29
	private function getFactoryClass(): string
30
	{
31
		return AbstractAsynchronousMessageProducerFactory::class;
32
	}
33
}
34