Code Duplication    Length = 16-19 lines in 3 locations

lib/custom/tests/MW/Filesystem/FlyDropboxTest.php 1 location

@@ 39-54 (lines=16) @@
36
	}
37
38
39
	public function testGetProviderAccess()
40
	{
41
		if( !class_exists( '\League\Flysystem\Dropbox\DropboxAdapter' ) ) {
42
			$this->markTestSkipped( 'Install Flysystem Dropbox adapter' );
43
		}
44
45
		$config = array(
46
			'accesstoken' => 'test',
47
			'appsecret' => 'test',
48
		);
49
		$object = new FlyDropbox( $config );
50
		$this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object );
51
52
		$this->expectException( 'Exception' );
53
		$object->has( 'test' );
54
	}
55
}
56

lib/custom/tests/MW/Filesystem/FlyGridfsTest.php 1 location

@@ 26-44 (lines=19) @@
23
	}
24
25
26
	public function testGetProviderToken()
27
	{
28
		if( !class_exists( '\League\Flysystem\GridFS\GridFSAdapter' ) ) {
29
			$this->markTestSkipped( 'Install Flysystem GridFS adapter' );
30
		}
31
32
		if( !class_exists( '\MongoClient' ) ) {
33
			$this->markTestSkipped( 'Install Mongo client extension' );
34
		}
35
36
		$config = array(
37
			'dbname' => 'test',
38
		);
39
		$object = new FlyGridfs( $config );
40
		$this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object );
41
42
		$this->expectException( 'Aimeos\MW\Filesystem\Exception' );
43
		$object->has( 'test' );
44
	}
45
}
46

lib/custom/tests/MW/Filesystem/FlyPhpcrTest.php 1 location

@@ 26-42 (lines=17) @@
23
	}
24
25
26
	public function testGetProviderRoot()
27
	{
28
		if( !class_exists( '\League\Flysystem\Phpcr\PhpcrAdapter' ) ) {
29
			$this->markTestSkipped( 'Install Flysystem PHPCR adapter' );
30
		}
31
32
		$config = array(
33
			'driver' => 'pdo_sqlite',
34
			'path' => '/tmp/fly_phpcr.db',
35
			'root' => '/',
36
		);
37
		$object = new FlyPhpcr( $config );
38
		$this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object );
39
40
		$this->expectException( '\PHPCR\RepositoryException' );
41
		$object->has( 'test' );
42
	}
43
}
44