FlyLocalTest::testGetProvider()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
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( !class_exists( '\\League\\Flysystem\\Filesystem' )
11
			|| !class_exists( '\\League\\Flysystem\\Local\\LocalFilesystemAdapter' )
12
		) {
13
			$this->markTestSkipped( 'Install Flysystem first' );
14
		}
15
	}
16
17
18
	public function testGetProvider()
19
	{
20
		$object = new FlyLocal( array( 'basedir' => dirname( dirname( __DIR__ ) ) ) );
21
		$this->assertInstanceof( \Aimeos\Base\Filesystem\Iface::class, $object );
22
23
		$object->has( 'test' );
24
	}
25
26
27
	public function testGetProviderNoBasedir()
28
	{
29
		$object = new FlyLocal( [] );
30
		$this->assertInstanceof( \Aimeos\Base\Filesystem\Iface::class, $object );
31
32
		$this->expectException( 'Aimeos\Base\Filesystem\Exception' );
33
		$object->has( 'test' );
34
	}
35
}
36