Passed
Push — master ( ff8f2e...aaaf39 )
by Aimeos
02:27
created

FlyDropboxTest::testGetProviderAccess()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 9
nc 2
nop 0
dl 0
loc 15
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
namespace Aimeos\Base\Filesystem;
4
5
6
class FlyDropboxTest extends \PHPUnit\Framework\TestCase
7
{
8
	protected function setUp() : void
9
	{
10
		if( !class_exists( '\\League\\Flysystem\\Filesystem' ) ) {
11
			$this->markTestSkipped( 'Install Flysystem first' );
12
		}
13
14
		if( !class_exists( '\\Spatie\\FlysystemDropbox\\DropboxAdapter' ) ) {
15
			$this->markTestSkipped( 'Install DropboxAdapter first' );
16
		}
17
	}
18
19
20
	public function testGetProvider()
21
	{
22
		$object = new FlyDropbox( [] );
23
		$this->assertInstanceof( \Aimeos\Base\Filesystem\Iface::class, $object );
24
25
		$this->expectException( 'Aimeos\Base\Filesystem\Exception' );
26
		$object->has( 'test' );
27
	}
28
29
30
	public function testGetProviderToken()
31
	{
32
		$object = new FlyDropbox( ['accesstoken' => 'test'] );
33
		$this->assertInstanceof( \Aimeos\Base\Filesystem\Iface::class, $object );
34
35
		$this->assertFalse( $object->has( 'test' ) );
36
	}
37
}
38