@@ 6-45 (lines=40) @@ | ||
3 | namespace Aimeos\MW\Filesystem; |
|
4 | ||
5 | ||
6 | class FlyGridfsTest 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 FlyGridfs( 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 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->setExpectedException( 'Aimeos\MW\Filesystem\Exception' ); |
|
43 | $object->has( 'test' ); |
|
44 | } |
|
45 | } |
|
46 |
@@ 6-41 (lines=36) @@ | ||
3 | namespace Aimeos\MW\Filesystem; |
|
4 | ||
5 | ||
6 | class FlyZipTest 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 | 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 |
@@ 6-48 (lines=43) @@ | ||
3 | namespace Aimeos\MW\Filesystem; |
|
4 | ||
5 | ||
6 | class FlyWebdavTest 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 | if( !class_exists( '\League\Flysystem\WebDAV\WebDAVAdapter' ) ) { |
|
19 | $this->markTestSkipped( 'Install Flysystem WebDAV adapter' ); |
|
20 | } |
|
21 | ||
22 | try |
|
23 | { |
|
24 | $object = new FlyWebdav( array( 'baseUri' => 'http://test.webdav.org/dav/' ) ); |
|
25 | $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
26 | ||
27 | $object->has( 'test' ); |
|
28 | } |
|
29 | catch( \Sabre\HTTP\ClientException $e ) |
|
30 | { |
|
31 | $this->markTestSkipped( $e->getMessage() ); |
|
32 | } |
|
33 | } |
|
34 | ||
35 | ||
36 | public function testGetProviderNoBaseuri() |
|
37 | { |
|
38 | if( !class_exists( '\League\Flysystem\WebDAV\WebDAVAdapter' ) ) { |
|
39 | $this->markTestSkipped( 'Install Flysystem WebDAV adapter' ); |
|
40 | } |
|
41 | ||
42 | $object = new FlyWebdav( array() ); |
|
43 | $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
44 | ||
45 | $this->setExpectedException( '\InvalidArgumentException' ); |
|
46 | $object->has( 'test' ); |
|
47 | } |
|
48 | } |
|
49 |