FlyAzureTest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 6
eloc 17
dl 0
loc 41
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetProvider() 0 11 2
A setUp() 0 4 2
A testGetProviderNoEndpoint() 0 7 1
A testGetProviderNoContainer() 0 7 1
1
<?php
2
3
namespace Aimeos\Base\Filesystem;
4
5
6
class FlyAzureTest 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
15
16
	public function testGetProvider()
17
	{
18
		if( !class_exists( '\League\Flysystem\AzureBlobStorage\AzureBlobStorageAdapter' ) ) {
19
			$this->markTestSkipped( 'Install Flysystem Azure adapter' );
20
		}
21
22
		$object = new FlyAzure( ['endpoint' => 'test', 'container' => '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 testGetProviderNoEndpoint()
31
	{
32
		$object = new FlyAzure( [] );
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
40
	public function testGetProviderNoContainer()
41
	{
42
		$object = new FlyAzure( ['endpoint' => 'test'] );
43
		$this->assertInstanceof( \Aimeos\Base\Filesystem\Iface::class, $object );
44
45
		$this->expectException( \Aimeos\Base\Filesystem\Exception::class );
46
		$object->has( 'test' );
47
	}
48
}
49