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 | class FlyLocalTest 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 FlyLocal( array( 'basedir' => dirname( dirname( __DIR__ ) ) ) ); |
||
19 | $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
||
20 | |||
21 | $object->has( 'test' ); |
||
22 | } |
||
23 | |||
24 | |||
25 | View Code Duplication | public function testGetProviderNoBasedir() |
|
0 ignored issues
–
show
|
|||
26 | { |
||
27 | $object = new FlyLocal( [] ); |
||
28 | $this->assertInstanceof( \Aimeos\MW\Filesystem\Iface::class, $object ); |
||
29 | |||
30 | $this->setExpectedException( 'Aimeos\MW\Filesystem\Exception' ); |
||
31 | $object->has( 'test' ); |
||
32 | } |
||
33 | } |
||
34 |
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.