@@ -7,35 +7,35 @@ |
||
7 | 7 | { |
8 | 8 | protected function setUp() |
9 | 9 | { |
10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
11 | + $this->markTestSkipped('Install Flysystem first'); |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | 15 | |
16 | 16 | public function testGetProvider() |
17 | 17 | { |
18 | - if( !class_exists( '\League\Flysystem\ZipArchive\ZipArchiveAdapter' ) ) { |
|
19 | - $this->markTestSkipped( 'Install Flysystem ZipArchive adapter' ); |
|
18 | + if (!class_exists('\League\Flysystem\ZipArchive\ZipArchiveAdapter')) { |
|
19 | + $this->markTestSkipped('Install Flysystem ZipArchive adapter'); |
|
20 | 20 | } |
21 | 21 | |
22 | - $object = new FlyZip( [] ); |
|
23 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
22 | + $object = new FlyZip([]); |
|
23 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
24 | 24 | |
25 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
26 | - $object->has( 'test' ); |
|
25 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
26 | + $object->has('test'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | public function testGetProviderFilepath() |
31 | 31 | { |
32 | - if( !class_exists( '\League\Flysystem\ZipArchive\ZipArchiveAdapter' ) ) { |
|
33 | - $this->markTestSkipped( 'Install Flysystem ZipArchive adapter' ); |
|
32 | + if (!class_exists('\League\Flysystem\ZipArchive\ZipArchiveAdapter')) { |
|
33 | + $this->markTestSkipped('Install Flysystem ZipArchive adapter'); |
|
34 | 34 | } |
35 | 35 | |
36 | - $object = new FlyZip( array( 'filepath' => '/tmp/flytest.zip' ) ); |
|
37 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
36 | + $object = new FlyZip(array('filepath' => '/tmp/flytest.zip')); |
|
37 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
38 | 38 | |
39 | - $object->has( 'test' ); |
|
39 | + $object->has('test'); |
|
40 | 40 | } |
41 | 41 | } |
@@ -7,19 +7,19 @@ discard block |
||
7 | 7 | { |
8 | 8 | protected function setUp() |
9 | 9 | { |
10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
11 | + $this->markTestSkipped('Install Flysystem first'); |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | 15 | |
16 | 16 | public function testGetProvider() |
17 | 17 | { |
18 | - $object = new FlyDropbox( [] ); |
|
19 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
18 | + $object = new FlyDropbox([]); |
|
19 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
20 | 20 | |
21 | - $this->setExpectedException( 'Aimeos\MW\Filesystem\Exception' ); |
|
22 | - $object->has( 'test' ); |
|
21 | + $this->setExpectedException('Aimeos\MW\Filesystem\Exception'); |
|
22 | + $object->has('test'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
@@ -28,28 +28,28 @@ discard block |
||
28 | 28 | $config = array( |
29 | 29 | 'accesstoken' => 'test', |
30 | 30 | ); |
31 | - $object = new FlyDropbox( $config ); |
|
32 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
31 | + $object = new FlyDropbox($config); |
|
32 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
33 | 33 | |
34 | - $this->setExpectedException( 'Aimeos\MW\Filesystem\Exception' ); |
|
35 | - $object->has( 'test' ); |
|
34 | + $this->setExpectedException('Aimeos\MW\Filesystem\Exception'); |
|
35 | + $object->has('test'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testGetProviderAccess() |
40 | 40 | { |
41 | - if( !class_exists( '\League\Flysystem\Dropbox\DropboxAdapter' ) ) { |
|
42 | - $this->markTestSkipped( 'Install Flysystem Dropbox adapter' ); |
|
41 | + if (!class_exists('\League\Flysystem\Dropbox\DropboxAdapter')) { |
|
42 | + $this->markTestSkipped('Install Flysystem Dropbox adapter'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | $config = array( |
46 | 46 | 'accesstoken' => 'test', |
47 | 47 | 'appsecret' => 'test', |
48 | 48 | ); |
49 | - $object = new FlyDropbox( $config ); |
|
50 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
49 | + $object = new FlyDropbox($config); |
|
50 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
51 | 51 | |
52 | - $this->setExpectedException( 'Exception' ); |
|
53 | - $object->has( 'test' ); |
|
52 | + $this->setExpectedException('Exception'); |
|
53 | + $object->has('test'); |
|
54 | 54 | } |
55 | 55 | } |
@@ -7,21 +7,21 @@ |
||
7 | 7 | { |
8 | 8 | protected function setUp() |
9 | 9 | { |
10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
11 | + $this->markTestSkipped('Install Flysystem first'); |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | 15 | |
16 | 16 | public function testGetProvider() |
17 | 17 | { |
18 | - if( !class_exists( '\League\Flysystem\Sftp\SftpAdapter' ) ) { |
|
19 | - $this->markTestSkipped( 'Install Flysystem SFTP adapter' ); |
|
18 | + if (!class_exists('\League\Flysystem\Sftp\SftpAdapter')) { |
|
19 | + $this->markTestSkipped('Install Flysystem SFTP adapter'); |
|
20 | 20 | } |
21 | 21 | |
22 | - $object = new FlySftp( array( 'host' => 'test.rebex.net', 'username' => 'demo', 'password' => 'password' ) ); |
|
23 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
22 | + $object = new FlySftp(array('host' => 'test.rebex.net', 'username' => 'demo', 'password' => 'password')); |
|
23 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
24 | 24 | |
25 | - $object->has( 'test' ); |
|
25 | + $object->has('test'); |
|
26 | 26 | } |
27 | 27 | } |
@@ -7,32 +7,32 @@ |
||
7 | 7 | { |
8 | 8 | protected function setUp() |
9 | 9 | { |
10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
11 | + $this->markTestSkipped('Install Flysystem first'); |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | 15 | |
16 | 16 | public function testGetProvider() |
17 | 17 | { |
18 | - if( !class_exists( '\League\Flysystem\AwsS3v3\AwsS3Adapter' ) ) { |
|
19 | - $this->markTestSkipped( 'Install Flysystem AwsS3v3 adapter' ); |
|
18 | + if (!class_exists('\League\Flysystem\AwsS3v3\AwsS3Adapter')) { |
|
19 | + $this->markTestSkipped('Install Flysystem AwsS3v3 adapter'); |
|
20 | 20 | } |
21 | 21 | |
22 | - $object = new FlyAwsS3( array( 'bucket' => 'test' ) ); |
|
23 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
22 | + $object = new FlyAwsS3(array('bucket' => 'test')); |
|
23 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
24 | 24 | |
25 | - $this->setExpectedException( 'InvalidArgumentException' ); |
|
26 | - $object->has( 'test' ); |
|
25 | + $this->setExpectedException('InvalidArgumentException'); |
|
26 | + $object->has('test'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | public function testGetProviderNoBucket() |
31 | 31 | { |
32 | - $object = new FlyAwsS3( [] ); |
|
33 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
32 | + $object = new FlyAwsS3([]); |
|
33 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
34 | 34 | |
35 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
36 | - $object->has( 'test' ); |
|
35 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
36 | + $object->has('test'); |
|
37 | 37 | } |
38 | 38 | } |
@@ -7,42 +7,42 @@ |
||
7 | 7 | { |
8 | 8 | protected function setUp() |
9 | 9 | { |
10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
11 | + $this->markTestSkipped('Install Flysystem first'); |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | 15 | |
16 | 16 | public function testGetProvider() |
17 | 17 | { |
18 | - if( !class_exists( '\League\Flysystem\WebDAV\WebDAVAdapter' ) ) { |
|
19 | - $this->markTestSkipped( 'Install Flysystem WebDAV adapter' ); |
|
18 | + if (!class_exists('\League\Flysystem\WebDAV\WebDAVAdapter')) { |
|
19 | + $this->markTestSkipped('Install Flysystem WebDAV adapter'); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | try |
23 | 23 | { |
24 | - $object = new FlyWebdav( array( 'baseUri' => 'http://test.webdav.org/dav/' ) ); |
|
25 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
24 | + $object = new FlyWebdav(array('baseUri' => 'http://test.webdav.org/dav/')); |
|
25 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
26 | 26 | |
27 | - $object->has( 'test' ); |
|
27 | + $object->has('test'); |
|
28 | 28 | } |
29 | - catch( \Exception $e ) |
|
29 | + catch (\Exception $e) |
|
30 | 30 | { |
31 | - $this->markTestSkipped( $e->getMessage() ); |
|
31 | + $this->markTestSkipped($e->getMessage()); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | public function testGetProviderNoBaseuri() |
37 | 37 | { |
38 | - if( !class_exists( '\League\Flysystem\WebDAV\WebDAVAdapter' ) ) { |
|
39 | - $this->markTestSkipped( 'Install Flysystem WebDAV adapter' ); |
|
38 | + if (!class_exists('\League\Flysystem\WebDAV\WebDAVAdapter')) { |
|
39 | + $this->markTestSkipped('Install Flysystem WebDAV adapter'); |
|
40 | 40 | } |
41 | 41 | |
42 | - $object = new FlyWebdav( [] ); |
|
43 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
42 | + $object = new FlyWebdav([]); |
|
43 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
44 | 44 | |
45 | - $this->setExpectedException( \InvalidArgumentException::class ); |
|
46 | - $object->has( 'test' ); |
|
45 | + $this->setExpectedException(\InvalidArgumentException::class); |
|
46 | + $object->has('test'); |
|
47 | 47 | } |
48 | 48 | } |
@@ -25,8 +25,7 @@ |
||
25 | 25 | $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
26 | 26 | |
27 | 27 | $object->has( 'test' ); |
28 | - } |
|
29 | - catch( \Exception $e ) |
|
28 | + } catch( \Exception $e ) |
|
30 | 29 | { |
31 | 30 | $this->markTestSkipped( $e->getMessage() ); |
32 | 31 | } |
@@ -7,26 +7,26 @@ discard block |
||
7 | 7 | { |
8 | 8 | protected function setUp() |
9 | 9 | { |
10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
11 | + $this->markTestSkipped('Install Flysystem first'); |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | 15 | |
16 | 16 | public function testGetProvider() |
17 | 17 | { |
18 | - $object = new FlyPhpcr( [] ); |
|
19 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
18 | + $object = new FlyPhpcr([]); |
|
19 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
20 | 20 | |
21 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
22 | - $object->has( 'test' ); |
|
21 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
22 | + $object->has('test'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testGetProviderRoot() |
27 | 27 | { |
28 | - if( !class_exists( '\League\Flysystem\Phpcr\PhpcrAdapter' ) ) { |
|
29 | - $this->markTestSkipped( 'Install Flysystem PHPCR adapter' ); |
|
28 | + if (!class_exists('\League\Flysystem\Phpcr\PhpcrAdapter')) { |
|
29 | + $this->markTestSkipped('Install Flysystem PHPCR adapter'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | $config = array( |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | 'path' => '/tmp/fly_phpcr.db', |
35 | 35 | 'root' => '/', |
36 | 36 | ); |
37 | - $object = new FlyPhpcr( $config ); |
|
38 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
37 | + $object = new FlyPhpcr($config); |
|
38 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
39 | 39 | |
40 | - $this->setExpectedException( \PHPCR\RepositoryException::class ); |
|
41 | - $object->has( 'test' ); |
|
40 | + $this->setExpectedException(\PHPCR\RepositoryException::class); |
|
41 | + $object->has('test'); |
|
42 | 42 | } |
43 | 43 | } |
@@ -11,394 +11,394 @@ |
||
11 | 11 | |
12 | 12 | protected function setUp() |
13 | 13 | { |
14 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
15 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
14 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
15 | + $this->markTestSkipped('Install Flysystem first'); |
|
16 | 16 | } |
17 | 17 | |
18 | - $this->object = $this->getMockBuilder( '\\Aimeos\\MW\\Filesystem\\FlyNone' ) |
|
19 | - ->setConstructorArgs( array( array( 'adapter' => 'FlyNone' ) ) ) |
|
20 | - ->setMethods( array( 'getProvider' ) ) |
|
18 | + $this->object = $this->getMockBuilder('\\Aimeos\\MW\\Filesystem\\FlyNone') |
|
19 | + ->setConstructorArgs(array(array('adapter' => 'FlyNone'))) |
|
20 | + ->setMethods(array('getProvider')) |
|
21 | 21 | ->getMock(); |
22 | 22 | |
23 | - $this->mock = $this->getMockBuilder( '\\League\\Flysystem\\FilesystemInterface' ) |
|
23 | + $this->mock = $this->getMockBuilder('\\League\\Flysystem\\FilesystemInterface') |
|
24 | 24 | ->disableOriginalConstructor() |
25 | 25 | ->getMock(); |
26 | 26 | |
27 | - $this->object->expects( $this->once() )->method( 'getProvider' ) |
|
28 | - ->will( $this->returnValue( $this->mock ) ); |
|
27 | + $this->object->expects($this->once())->method('getProvider') |
|
28 | + ->will($this->returnValue($this->mock)); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | protected function tearDown() |
33 | 33 | { |
34 | - unset( $this->object, $this->mock ); |
|
34 | + unset($this->object, $this->mock); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testIsdir() |
39 | 39 | { |
40 | - $this->mock->expects( $this->once() )->method( 'getMetadata' ) |
|
41 | - ->will( $this->returnValue( array( 'type' => 'dir' ) ) ); |
|
40 | + $this->mock->expects($this->once())->method('getMetadata') |
|
41 | + ->will($this->returnValue(array('type' => 'dir'))); |
|
42 | 42 | |
43 | - $this->assertTrue( $this->object->isdir( 'test' ) ); |
|
43 | + $this->assertTrue($this->object->isdir('test')); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | 47 | public function testIsdirFalse() |
48 | 48 | { |
49 | - $this->mock->expects( $this->once() )->method( 'getMetadata' ) |
|
50 | - ->will( $this->returnValue( array( 'type' => 'file' ) ) ); |
|
49 | + $this->mock->expects($this->once())->method('getMetadata') |
|
50 | + ->will($this->returnValue(array('type' => 'file'))); |
|
51 | 51 | |
52 | - $this->assertFalse( $this->object->isdir( 'test' ) ); |
|
52 | + $this->assertFalse($this->object->isdir('test')); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
56 | 56 | public function testMkdir() |
57 | 57 | { |
58 | - $this->mock->expects( $this->once() )->method( 'createDir' ) |
|
59 | - ->will( $this->returnValue( true ) ); |
|
58 | + $this->mock->expects($this->once())->method('createDir') |
|
59 | + ->will($this->returnValue(true)); |
|
60 | 60 | |
61 | - $this->object->mkdir( 'test' ); |
|
61 | + $this->object->mkdir('test'); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | |
65 | 65 | public function testMkdirException() |
66 | 66 | { |
67 | - $this->mock->expects( $this->once() )->method( 'createDir' ) |
|
68 | - ->will( $this->returnValue( false ) ); |
|
67 | + $this->mock->expects($this->once())->method('createDir') |
|
68 | + ->will($this->returnValue(false)); |
|
69 | 69 | |
70 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
71 | - $this->object->mkdir( 'test' ); |
|
70 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
71 | + $this->object->mkdir('test'); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
75 | 75 | public function testRmdir() |
76 | 76 | { |
77 | - $this->mock->expects( $this->once() )->method( 'deleteDir' ) |
|
78 | - ->will( $this->returnValue( true ) ); |
|
77 | + $this->mock->expects($this->once())->method('deleteDir') |
|
78 | + ->will($this->returnValue(true)); |
|
79 | 79 | |
80 | - $this->object->rmdir( 'test' ); |
|
80 | + $this->object->rmdir('test'); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
84 | 84 | public function testRmdirException() |
85 | 85 | { |
86 | - $this->mock->expects( $this->once() )->method( 'deleteDir' ) |
|
87 | - ->will( $this->returnValue( false ) ); |
|
86 | + $this->mock->expects($this->once())->method('deleteDir') |
|
87 | + ->will($this->returnValue(false)); |
|
88 | 88 | |
89 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
90 | - $this->object->rmdir( 'test' ); |
|
89 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
90 | + $this->object->rmdir('test'); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
94 | 94 | public function testScan() |
95 | 95 | { |
96 | - $this->mock->expects( $this->once() )->method( 'listContents' ) |
|
97 | - ->will( $this->returnValue( array( array( 'basename' => 'test' ) ) ) ); |
|
96 | + $this->mock->expects($this->once())->method('listContents') |
|
97 | + ->will($this->returnValue(array(array('basename' => 'test')))); |
|
98 | 98 | |
99 | - $this->assertEquals( array( 'test' ), $this->object->scan() ); |
|
99 | + $this->assertEquals(array('test'), $this->object->scan()); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | |
103 | 103 | public function testSize() |
104 | 104 | { |
105 | - $this->mock->expects( $this->once() )->method( 'getSize' ) |
|
106 | - ->will( $this->returnValue( 4 ) ); |
|
105 | + $this->mock->expects($this->once())->method('getSize') |
|
106 | + ->will($this->returnValue(4)); |
|
107 | 107 | |
108 | - $this->assertEquals( 4, $this->object->size( 'test' ) ); |
|
108 | + $this->assertEquals(4, $this->object->size('test')); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
112 | 112 | public function testSizeException() |
113 | 113 | { |
114 | - $this->mock->expects( $this->once() )->method( 'getSize' ) |
|
115 | - ->will( $this->returnValue( false ) ); |
|
114 | + $this->mock->expects($this->once())->method('getSize') |
|
115 | + ->will($this->returnValue(false)); |
|
116 | 116 | |
117 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
118 | - $this->object->size( 'test' ); |
|
117 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
118 | + $this->object->size('test'); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
122 | 122 | public function testSizeException2() |
123 | 123 | { |
124 | - $this->mock->expects( $this->once() )->method( 'getSize' ) |
|
125 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
124 | + $this->mock->expects($this->once())->method('getSize') |
|
125 | + ->will($this->throwException(new \RuntimeException())); |
|
126 | 126 | |
127 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
128 | - $this->object->size( 'test' ); |
|
127 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
128 | + $this->object->size('test'); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | |
132 | 132 | public function testTime() |
133 | 133 | { |
134 | - $this->mock->expects( $this->once() )->method( 'getTimestamp' ) |
|
135 | - ->will( $this->returnValue( 4 ) ); |
|
134 | + $this->mock->expects($this->once())->method('getTimestamp') |
|
135 | + ->will($this->returnValue(4)); |
|
136 | 136 | |
137 | - $this->assertEquals( 4, $this->object->time( 'test' ) ); |
|
137 | + $this->assertEquals(4, $this->object->time('test')); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | |
141 | 141 | public function testTimeException() |
142 | 142 | { |
143 | - $this->mock->expects( $this->once() )->method( 'getTimestamp' ) |
|
144 | - ->will( $this->returnValue( false ) ); |
|
143 | + $this->mock->expects($this->once())->method('getTimestamp') |
|
144 | + ->will($this->returnValue(false)); |
|
145 | 145 | |
146 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
147 | - $this->object->time( 'test' ); |
|
146 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
147 | + $this->object->time('test'); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | |
151 | 151 | public function testTimeException2() |
152 | 152 | { |
153 | - $this->mock->expects( $this->once() )->method( 'getTimestamp' ) |
|
154 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
153 | + $this->mock->expects($this->once())->method('getTimestamp') |
|
154 | + ->will($this->throwException(new \RuntimeException())); |
|
155 | 155 | |
156 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
157 | - $this->object->time( 'test' ); |
|
156 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
157 | + $this->object->time('test'); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
161 | 161 | public function testRm() |
162 | 162 | { |
163 | - $this->mock->expects( $this->once() )->method( 'delete' ) |
|
164 | - ->will( $this->returnValue( 4 ) ); |
|
163 | + $this->mock->expects($this->once())->method('delete') |
|
164 | + ->will($this->returnValue(4)); |
|
165 | 165 | |
166 | - $this->object->rm( 'test' ); |
|
166 | + $this->object->rm('test'); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | |
170 | 170 | public function testRmException() |
171 | 171 | { |
172 | - $this->mock->expects( $this->once() )->method( 'delete' ) |
|
173 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
172 | + $this->mock->expects($this->once())->method('delete') |
|
173 | + ->will($this->throwException(new \RuntimeException())); |
|
174 | 174 | |
175 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
176 | - $this->object->rm( 'test' ); |
|
175 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
176 | + $this->object->rm('test'); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | |
180 | 180 | public function testHas() |
181 | 181 | { |
182 | - $this->mock->expects( $this->once() )->method( 'has' ) |
|
183 | - ->will( $this->returnValue( true ) ); |
|
182 | + $this->mock->expects($this->once())->method('has') |
|
183 | + ->will($this->returnValue(true)); |
|
184 | 184 | |
185 | - $result = $this->object->has( 'test' ); |
|
185 | + $result = $this->object->has('test'); |
|
186 | 186 | |
187 | - $this->assertTrue( $result ); |
|
187 | + $this->assertTrue($result); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | |
191 | 191 | public function testHasFalse() |
192 | 192 | { |
193 | - $this->mock->expects( $this->once() )->method( 'has' ) |
|
194 | - ->will( $this->returnValue( false ) ); |
|
193 | + $this->mock->expects($this->once())->method('has') |
|
194 | + ->will($this->returnValue(false)); |
|
195 | 195 | |
196 | - $result = $this->object->has( 'test' ); |
|
196 | + $result = $this->object->has('test'); |
|
197 | 197 | |
198 | - $this->assertFalse( $result ); |
|
198 | + $this->assertFalse($result); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | |
202 | 202 | public function testRead() |
203 | 203 | { |
204 | - $this->mock->expects( $this->once() )->method( 'read' ) |
|
205 | - ->will( $this->returnValue( 'value' ) ); |
|
204 | + $this->mock->expects($this->once())->method('read') |
|
205 | + ->will($this->returnValue('value')); |
|
206 | 206 | |
207 | - $this->assertEquals( 'value', $this->object->read( 'test' ) ); |
|
207 | + $this->assertEquals('value', $this->object->read('test')); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | |
211 | 211 | public function testReadException() |
212 | 212 | { |
213 | - $this->mock->expects( $this->once() )->method( 'read' ) |
|
214 | - ->will( $this->returnValue( false ) ); |
|
213 | + $this->mock->expects($this->once())->method('read') |
|
214 | + ->will($this->returnValue(false)); |
|
215 | 215 | |
216 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
217 | - $this->object->read( 'test' ); |
|
216 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
217 | + $this->object->read('test'); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | |
221 | 221 | public function testReadException2() |
222 | 222 | { |
223 | - $this->mock->expects( $this->once() )->method( 'read' ) |
|
224 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
223 | + $this->mock->expects($this->once())->method('read') |
|
224 | + ->will($this->throwException(new \RuntimeException())); |
|
225 | 225 | |
226 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
227 | - $this->object->read( 'test' ); |
|
226 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
227 | + $this->object->read('test'); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | |
231 | 231 | public function testReadf() |
232 | 232 | { |
233 | - $file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'flytest'; |
|
234 | - file_put_contents( $file, 'test' ); |
|
233 | + $file = sys_get_temp_dir().DIRECTORY_SEPARATOR.'flytest'; |
|
234 | + file_put_contents($file, 'test'); |
|
235 | 235 | |
236 | - $this->mock->expects( $this->once() )->method( 'readStream' ) |
|
237 | - ->will( $this->returnValue( fopen( $file, 'r' ) ) ); |
|
236 | + $this->mock->expects($this->once())->method('readStream') |
|
237 | + ->will($this->returnValue(fopen($file, 'r'))); |
|
238 | 238 | |
239 | - $result = $this->object->readf( 'file' ); |
|
239 | + $result = $this->object->readf('file'); |
|
240 | 240 | |
241 | - $this->assertEquals( 'test', file_get_contents( $result ) ); |
|
241 | + $this->assertEquals('test', file_get_contents($result)); |
|
242 | 242 | |
243 | - unlink( $result ); |
|
244 | - unlink( $file ); |
|
243 | + unlink($result); |
|
244 | + unlink($file); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | |
248 | 248 | public function testReads() |
249 | 249 | { |
250 | - $this->mock->expects( $this->once() )->method( 'readStream' ) |
|
251 | - ->will( $this->returnValue( 1 ) ); |
|
250 | + $this->mock->expects($this->once())->method('readStream') |
|
251 | + ->will($this->returnValue(1)); |
|
252 | 252 | |
253 | - $this->assertEquals( 1, $this->object->reads( 'test' ) ); |
|
253 | + $this->assertEquals(1, $this->object->reads('test')); |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | |
257 | 257 | public function testReadsException() |
258 | 258 | { |
259 | - $this->mock->expects( $this->once() )->method( 'readStream' ) |
|
260 | - ->will( $this->returnValue( false ) ); |
|
259 | + $this->mock->expects($this->once())->method('readStream') |
|
260 | + ->will($this->returnValue(false)); |
|
261 | 261 | |
262 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
263 | - $this->object->reads( 'test' ); |
|
262 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
263 | + $this->object->reads('test'); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | |
267 | 267 | public function testReadsException2() |
268 | 268 | { |
269 | - $this->mock->expects( $this->once() )->method( 'readStream' ) |
|
270 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
269 | + $this->mock->expects($this->once())->method('readStream') |
|
270 | + ->will($this->throwException(new \RuntimeException())); |
|
271 | 271 | |
272 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
273 | - $this->object->reads( 'test' ); |
|
272 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
273 | + $this->object->reads('test'); |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | |
277 | 277 | public function testWrite() |
278 | 278 | { |
279 | - $this->mock->expects( $this->once() )->method( 'put' ) |
|
280 | - ->will( $this->returnValue( true ) ); |
|
279 | + $this->mock->expects($this->once())->method('put') |
|
280 | + ->will($this->returnValue(true)); |
|
281 | 281 | |
282 | - $this->object->write( 'test', 'value' ); |
|
282 | + $this->object->write('test', 'value'); |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | |
286 | 286 | public function testWriteException() |
287 | 287 | { |
288 | - $this->mock->expects( $this->once() )->method( 'put' ) |
|
289 | - ->will( $this->returnValue( false ) ); |
|
288 | + $this->mock->expects($this->once())->method('put') |
|
289 | + ->will($this->returnValue(false)); |
|
290 | 290 | |
291 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
292 | - $this->object->write( 'test', 'value' ); |
|
291 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
292 | + $this->object->write('test', 'value'); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | |
296 | 296 | public function testWriteException2() |
297 | 297 | { |
298 | - $this->mock->expects( $this->once() )->method( 'put' ) |
|
299 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
298 | + $this->mock->expects($this->once())->method('put') |
|
299 | + ->will($this->throwException(new \RuntimeException())); |
|
300 | 300 | |
301 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
302 | - $this->object->write( 'test', 'value' ); |
|
301 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
302 | + $this->object->write('test', 'value'); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testWritef() |
307 | 307 | { |
308 | - $file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'flytest'; |
|
309 | - file_put_contents( $file, 'test' ); |
|
308 | + $file = sys_get_temp_dir().DIRECTORY_SEPARATOR.'flytest'; |
|
309 | + file_put_contents($file, 'test'); |
|
310 | 310 | |
311 | - $this->mock->expects( $this->once() )->method( 'putStream' ); |
|
311 | + $this->mock->expects($this->once())->method('putStream'); |
|
312 | 312 | |
313 | - $this->object->writef( 'file', $file ); |
|
313 | + $this->object->writef('file', $file); |
|
314 | 314 | |
315 | - unlink( $file ); |
|
315 | + unlink($file); |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | |
319 | 319 | public function testWrites() |
320 | 320 | { |
321 | - $this->mock->expects( $this->once() )->method( 'putStream' ) |
|
322 | - ->will( $this->returnValue( true ) ); |
|
321 | + $this->mock->expects($this->once())->method('putStream') |
|
322 | + ->will($this->returnValue(true)); |
|
323 | 323 | |
324 | - $this->object->writes( 'test', 1 ); |
|
324 | + $this->object->writes('test', 1); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | |
328 | 328 | public function testWritesException() |
329 | 329 | { |
330 | - $this->mock->expects( $this->once() )->method( 'putStream' ) |
|
331 | - ->will( $this->returnValue( false ) ); |
|
330 | + $this->mock->expects($this->once())->method('putStream') |
|
331 | + ->will($this->returnValue(false)); |
|
332 | 332 | |
333 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
334 | - $this->object->writes( 'test', 2 ); |
|
333 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
334 | + $this->object->writes('test', 2); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | |
338 | 338 | public function testWritesException2() |
339 | 339 | { |
340 | - $this->mock->expects( $this->once() )->method( 'putStream' ) |
|
341 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
340 | + $this->mock->expects($this->once())->method('putStream') |
|
341 | + ->will($this->throwException(new \RuntimeException())); |
|
342 | 342 | |
343 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
344 | - $this->object->writes( 'test', null ); |
|
343 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
344 | + $this->object->writes('test', null); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | |
348 | 348 | public function testMove() |
349 | 349 | { |
350 | - $this->mock->expects( $this->once() )->method( 'rename' ) |
|
351 | - ->will( $this->returnValue( true ) ); |
|
350 | + $this->mock->expects($this->once())->method('rename') |
|
351 | + ->will($this->returnValue(true)); |
|
352 | 352 | |
353 | - $this->object->move( 'file1', 'file2' ); |
|
353 | + $this->object->move('file1', 'file2'); |
|
354 | 354 | } |
355 | 355 | |
356 | 356 | |
357 | 357 | public function testMoveException() |
358 | 358 | { |
359 | - $this->mock->expects( $this->once() )->method( 'rename' ) |
|
360 | - ->will( $this->returnValue( false ) ); |
|
359 | + $this->mock->expects($this->once())->method('rename') |
|
360 | + ->will($this->returnValue(false)); |
|
361 | 361 | |
362 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
363 | - $this->object->move( 'file1', 'file2' ); |
|
362 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
363 | + $this->object->move('file1', 'file2'); |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | |
367 | 367 | public function testMoveException2() |
368 | 368 | { |
369 | - $this->mock->expects( $this->once() )->method( 'rename' ) |
|
370 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
369 | + $this->mock->expects($this->once())->method('rename') |
|
370 | + ->will($this->throwException(new \RuntimeException())); |
|
371 | 371 | |
372 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
373 | - $this->object->move( 'file1', 'file2' ); |
|
372 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
373 | + $this->object->move('file1', 'file2'); |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | |
377 | 377 | public function testCopy() |
378 | 378 | { |
379 | - $this->mock->expects( $this->once() )->method( 'copy' ) |
|
380 | - ->will( $this->returnValue( true ) ); |
|
379 | + $this->mock->expects($this->once())->method('copy') |
|
380 | + ->will($this->returnValue(true)); |
|
381 | 381 | |
382 | - $this->object->copy( 'file1', 'file2' ); |
|
382 | + $this->object->copy('file1', 'file2'); |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | |
386 | 386 | public function testCopyException() |
387 | 387 | { |
388 | - $this->mock->expects( $this->once() )->method( 'copy' ) |
|
389 | - ->will( $this->returnValue( false ) ); |
|
388 | + $this->mock->expects($this->once())->method('copy') |
|
389 | + ->will($this->returnValue(false)); |
|
390 | 390 | |
391 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
392 | - $this->object->copy( 'file1', 'file2' ); |
|
391 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
392 | + $this->object->copy('file1', 'file2'); |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | |
396 | 396 | public function testCopyException2() |
397 | 397 | { |
398 | - $this->mock->expects( $this->once() )->method( 'copy' ) |
|
399 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
398 | + $this->mock->expects($this->once())->method('copy') |
|
399 | + ->will($this->throwException(new \RuntimeException())); |
|
400 | 400 | |
401 | - $this->setExpectedException( \Aimeos\MW\Filesystem\Exception::class ); |
|
402 | - $this->object->copy( 'file1', 'file2' ); |
|
401 | + $this->setExpectedException(\Aimeos\MW\Filesystem\Exception::class); |
|
402 | + $this->object->copy('file1', 'file2'); |
|
403 | 403 | } |
404 | 404 | } |
@@ -7,17 +7,17 @@ |
||
7 | 7 | { |
8 | 8 | protected function setUp() |
9 | 9 | { |
10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
11 | + $this->markTestSkipped('Install Flysystem first'); |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | 15 | |
16 | 16 | public function testGetProvider() |
17 | 17 | { |
18 | - $object = new FlyFtp( array( 'host' => 'ftp.heise.de' ) ); |
|
19 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
18 | + $object = new FlyFtp(array('host' => 'ftp.heise.de')); |
|
19 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
20 | 20 | |
21 | - $object->has( 'test' ); |
|
21 | + $object->has('test'); |
|
22 | 22 | } |
23 | 23 | } |
@@ -7,21 +7,21 @@ |
||
7 | 7 | { |
8 | 8 | protected function setUp() |
9 | 9 | { |
10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
11 | + $this->markTestSkipped('Install Flysystem first'); |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | 15 | |
16 | 16 | public function testGetProvider() |
17 | 17 | { |
18 | - if( !class_exists( '\League\Flysystem\Memory\MemoryAdapter' ) ) { |
|
19 | - $this->markTestSkipped( 'Install Flysystem memory adapter' ); |
|
18 | + if (!class_exists('\League\Flysystem\Memory\MemoryAdapter')) { |
|
19 | + $this->markTestSkipped('Install Flysystem memory adapter'); |
|
20 | 20 | } |
21 | 21 | |
22 | - $object = new FlyMemory( [] ); |
|
23 | - $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
|
22 | + $object = new FlyMemory([]); |
|
23 | + $this->assertInstanceof(\Aimeos\MW\Filesystem\Iface::class, $object); |
|
24 | 24 | |
25 | - $object->has( 'test' ); |
|
25 | + $object->has('test'); |
|
26 | 26 | } |
27 | 27 | } |