Completed
Push — master ( 3aaa57...3b1bb7 )
by Aimeos
02:24
created

FlyRackspaceTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 5
c 2
b 0
f 1
lcom 1
cbo 1
dl 0
loc 33
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 2
A testGetProvider() 0 8 1
A testGetProviderContainer() 0 12 2
1
<?php
2
3
namespace Aimeos\MW\Filesystem;
4
5
6
class FlyRackspaceTest extends \PHPUnit_Framework_TestCase
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 FlyRackspace( array() );
19
		$this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object );
20
21
		$this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' );
22
		$object->has( 'test' );
23
	}
24
25
26
	public function testGetProviderContainer()
27
	{
28
		if( !class_exists( '\League\Flysystem\Rackspace\RackspaceAdapter' ) ) {
29
			$this->markTestSkipped( 'Install Flysystem Rackspace adapter' );
30
		}
31
32
		$object = new FlyRackspace( array( 'container' => 'test' ) );
33
		$this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object );
34
35
		$this->setExpectedException( '\OpenCloud\Common\Exceptions\CredentialError' );
36
		$object->has( 'test' );
37
	}
38
}
39