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

StandardTest::testGetException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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