FlyZipTest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 6

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetProviderFilepath() 0 10 2
A setUp() 0 4 2
A testGetProvider() 0 11 2
1
<?php
2
3
namespace Aimeos\Base\Filesystem;
4
5
6
class FlyZipTest 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\ZipArchive\ZipArchiveAdapter' ) ) {
19
			$this->markTestSkipped( 'Install Flysystem ZipArchive adapter' );
20
		}
21
22
		$object = new FlyZip( [] );
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 testGetProviderFilepath()
31
	{
32
		if( !class_exists( '\League\Flysystem\ZipArchive\ZipArchiveAdapter' ) ) {
33
			$this->markTestSkipped( 'Install Flysystem ZipArchive adapter' );
34
		}
35
36
		$object = new FlyZip( array( 'filepath' => '/tmp/flytest.zip' ) );
37
		$this->assertInstanceof( \Aimeos\Base\Filesystem\Iface::class, $object );
38
39
		$object->has( 'test' );
40
	}
41
}
42