Passed
Push — master ( b62909...01ab92 )
by Aimeos
02:37
created

StandardTest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
eloc 18
c 1
b 0
f 0
dl 0
loc 54
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A tearDown() 0 6 1
A testClone() 0 4 1
A testGetDatabaseConfig() 0 4 1
A testGetException() 0 4 1
A testGet() 0 4 1
A testGetFallback() 0 4 1
1
<?php
2
3
namespace Aimeos\Base\MQueue\Manager;
4
5
6
class StandardTest extends \PHPUnit\Framework\TestCase
7
{
8
	private $config;
9
	private $object;
10
11
12
	protected function setUp() : void
13
	{
14
		$this->config = \TestHelper::getConfig();
15
		$this->object = new \Aimeos\Base\MQueue\Manager\Standard( $this->config );
16
	}
17
18
19
	protected function tearDown() : void
20
	{
21
		$this->config->set( 'resource/mq-email', null );
22
		$this->config->set( 'resource/mq', null );
23
24
		unset( $this->object );
25
	}
26
27
28
	public function testClone()
29
	{
30
		$this->config->set( 'resource/mq-email', array( 'adapter' => 'None' ) );
31
		$this->assertInstanceof( 'Aimeos\Base\MQueue\Manager\Iface', clone $this->object );
32
	}
33
34
35
	public function testGet()
36
	{
37
		$this->config->set( 'resource/mq-email', array( 'adapter' => 'None' ) );
38
		$this->assertInstanceof( 'Aimeos\Base\MQueue\Iface', $this->object->get( 'mq-email' ) );
39
	}
40
41
42
	public function testGetFallback()
43
	{
44
		$this->config->set( 'resource/mq', array( 'adapter' => 'None' ) );
45
		$this->assertInstanceof( 'Aimeos\Base\MQueue\Iface', $this->object->get( 'mq-email' ) );
46
	}
47
48
49
	public function testGetException()
50
	{
51
		$this->expectException( \Aimeos\Base\MQueue\Exception::class );
52
		$this->object->get( 'xx' );
53
	}
54
55
56
	public function testGetDatabaseConfig()
57
	{
58
		$this->config->set( 'resource/mq-email', array( 'adapter' => 'None', 'db' => 'db' ) );
59
		$this->assertInstanceof( 'Aimeos\Base\MQueue\Iface', $this->object->get( 'mq-email' ) );
60
	}
61
}
62