These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Aimeos\MW\Filesystem; |
||
4 | |||
5 | |||
6 | View Code Duplication | class FlyWebdavTest extends \PHPUnit_Framework_TestCase |
|
0 ignored issues
–
show
|
|||
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 ) |
||
0 ignored issues
–
show
The class
Sabre\HTTP\ClientException does not exist. Did you forget a USE statement, or did you not list all dependencies?
Scrutinizer analyzes your It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.
Loading history...
|
|||
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 |
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.