getFactoryClass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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