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

FlyDropboxTest::testGetProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 10
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( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) {
11
			$this->markTestSkipped( 'Install Flysystem first' );
12
		}
13
	}
14
15
16
	public function testGetProvider()
17
	{
18
		$object = new FlyDropbox( [] );
19
		$this->assertInstanceof( \Aimeos\Base\Filesystem\Iface::class, $object );
20
21
		$this->expectException( 'Aimeos\Base\Filesystem\Exception' );
22
		$object->has( 'test' );
23
	}
24
25
26
	public function testGetProviderToken()
27
	{
28
		$config = array(
29
			'accesstoken' => 'test',
30
		);
31
		$object = new FlyDropbox( $config );
32
		$this->assertInstanceof( \Aimeos\Base\Filesystem\Iface::class, $object );
33
34
		$this->expectException( 'Aimeos\Base\Filesystem\Exception' );
35
		$object->has( 'test' );
36
	}
37
38
39
	public function testGetProviderAccess()
40
	{
41
		if( !class_exists( '\League\Flysystem\Dropbox\DropboxAdapter' ) ) {
42
			$this->markTestSkipped( 'Install Flysystem Dropbox adapter' );
43
		}
44
45
		$config = array(
46
			'accesstoken' => 'test',
47
			'appsecret' => 'test',
48
		);
49
		$object = new FlyDropbox( $config );
50
		$this->assertInstanceof( \Aimeos\Base\Filesystem\Iface::class, $object );
51
52
		$this->expectException( 'Exception' );
53
		$object->has( 'test' );
54
	}
55
}
56