Passed
Push — master ( 894e98...cda682 )
by Aimeos
18:42 queued 10:10
created

FlyLocalTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetProviderNoBasedir() 0 7 1
A setUp() 0 4 2
A testGetProvider() 0 6 1
1
<?php
2
3
namespace Aimeos\Base\Filesystem;
4
5
6
class FlyLocalTest extends \PHPUnit\Framework\TestCase
7
{
8
	protected function setUp() : void
9
	{
10
		if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) {
11
			$this->markTestSkipped( 'Install Flysystem first' );
12
		}
13
	}
14
15
16
	public function testGetProvider()
17
	{
18
		$object = new FlyLocal( array( 'basedir' => dirname( dirname( __DIR__ ) ) ) );
19
		$this->assertInstanceof( \Aimeos\Base\Filesystem\Iface::class, $object );
20
21
		$object->has( 'test' );
22
	}
23
24
25
	public function testGetProviderNoBasedir()
26
	{
27
		$object = new FlyLocal( [] );
28
		$this->assertInstanceof( \Aimeos\Base\Filesystem\Iface::class, $object );
29
30
		$this->expectException( 'Aimeos\Base\Filesystem\Exception' );
31
		$object->has( 'test' );
32
	}
33
}
34