FlyDropboxTest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 22
c 1
b 0
f 0
dl 0
loc 48
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 2
A testGetProviderAccess() 0 15 2
A testGetProviderToken() 0 10 1
A testGetProvider() 0 7 1
1
<?php
2
3
namespace Aimeos\MW\Filesystem;
4
5
6
class FlyDropboxTest extends \PHPUnit\Framework\TestCase
0 ignored issues
show
Bug introduced by Aimeos
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
{
8
	protected function setUp()
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\MW\Filesystem\Iface::class, $object );
20
21
		$this->setExpectedException( 'Aimeos\MW\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\MW\Filesystem\Iface::class, $object );
33
34
		$this->setExpectedException( 'Aimeos\MW\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\MW\Filesystem\Iface::class, $object );
51
52
		$this->setExpectedException( 'Exception' );
53
		$object->has( 'test' );
54
	}
55
}
56