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

FlyZipTest::setUp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 6
loc 6
rs 9.4285
cc 2
eloc 3
nc 2
nop 0
1
<?php
2
3
namespace Aimeos\MW\Filesystem;
4
5
6 View Code Duplication
class FlyZipTest extends \PHPUnit_Framework_TestCase
0 ignored issues
show
Duplication introduced by Aimeos
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

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
		if( !class_exists( '\League\Flysystem\ZipArchive\ZipArchiveAdapter' ) ) {
19
			$this->markTestSkipped( 'Install Flysystem ZipArchive adapter' );
20
		}
21
22
		$object = new FlyZip( array() );
23
		$this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object );
24
25
		$this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' );
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\MW\Filesystem\Iface', $object );
38
39
		$object->has( 'test' );
40
	}
41
}
42