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

StandardTest::testSleep()   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\Filesystem\Manager;
4
5
6
class StandardTest extends \PHPUnit\Framework\TestCase
7
{
8
	public function testGet()
9
	{
10
		$config = ['fs-media' => ['adapter' => 'Standard', 'basedir' => __DIR__]];
11
		$object = new \Aimeos\Base\Filesystem\Manager\Standard( $config );
12
13
		$this->assertInstanceof( 'Aimeos\Base\Filesystem\Iface', $object->get( 'fs-media' ) );
14
	}
15
16
17
	public function testGetFallback()
18
	{
19
		$config = ['fs' => ['adapter' => 'Standard', 'basedir' => __DIR__]];
20
		$object = new \Aimeos\Base\Filesystem\Manager\Standard( $config );
21
22
		$this->assertInstanceof( 'Aimeos\Base\Filesystem\Iface', $object->get( 'fs-media' ) );
23
	}
24
25
26
	public function testGetException()
27
	{
28
		$object = new \Aimeos\Base\Filesystem\Manager\Standard( [] );
29
30
		$this->expectException( \Aimeos\Base\Filesystem\Exception::class );
31
		$object->get( 'xx' );
32
	}
33
34
35
	public function testSleep()
36
	{
37
		$object = new \Aimeos\Base\Filesystem\Manager\Standard( [] );
38
		$this->assertEquals( ['config' => [], 'objects' => []], $object->__sleep() );
39
	}
40
}
41