Passed
Push — master ( f381ab...b62f3e )
by Aimeos
02:34
created

StandardTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 10
c 0
b 0
f 0
dl 0
loc 38
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 3 1
A tearDown() 0 3 1
A testGetFallback() 0 5 1
A testGetNew() 0 5 1
A testGet() 0 5 1
1
<?php
2
3
namespace Aimeos\Base\DB\Manager;
4
5
6
class StandardTest extends \PHPUnit\Framework\TestCase
7
{
8
	private $object;
9
10
11
	protected function setUp() : void
12
	{
13
		$this->object = new \Aimeos\Base\DB\Manager\Standard( \TestHelper::getConfig()->get( 'resource', [] ) );
14
	}
15
16
17
	protected function tearDown() : void
18
	{
19
		unset( $this->object );
20
	}
21
22
23
	public function testGet()
24
	{
25
		$conn = $this->object->get()->close();
26
27
		$this->assertInstanceOf( \Aimeos\Base\DB\Connection\Iface::class, $conn );
28
	}
29
30
31
	public function testGetNew()
32
	{
33
		$conn = $this->object->get( 'db', true )->close();
34
35
		$this->assertInstanceOf( \Aimeos\Base\DB\Connection\Iface::class, $conn );
36
	}
37
38
39
	public function testGetFallback()
40
	{
41
		$conn = $this->object->get( 'db-test' )->close();
42
43
		$this->assertInstanceOf( \Aimeos\Base\DB\Connection\Iface::class, $conn );
44
	}
45
}
46