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

StandardTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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