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

FlyGoogleCloudTest::testGetProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Aimeos\Base\Filesystem;
4
5
6
class FlyGoogleCloudTest 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( '\League\Flysystem\GoogleCloudStorage\GoogleCloudStorageAdapter' ) ) {
15
			$this->markTestSkipped( 'Install Flysystem GoogleCloudStorageAdapter adapter' );
16
		}
17
	}
18
19
20
	public function testGetProvider()
21
	{
22
		$object = new FlyGoogleCloud( ['bucket' => 'test'] );
23
		$this->assertInstanceof( \Aimeos\Base\Filesystem\Iface::class, $object );
24
25
		$this->expectException( \Aimeos\Base\Filesystem\Exception::class );
26
		$object->has( 'test' );
27
	}
28
29
30
	public function testGetProviderNoBucket()
31
	{
32
		$object = new FlyGoogleCloud( [] );
33
		$this->assertInstanceof( \Aimeos\Base\Filesystem\Iface::class, $object );
34
35
		$this->expectException( \Aimeos\Base\Filesystem\Exception::class );
36
		$object->has( 'test' );
37
	}
38
}
39