Completed
Push — master ( c1652d...1bc96e )
by Aimeos
02:25
created

lib/custom/tests/MW/Filesystem/FlyPhpcrTest.php (1 issue)

Upgrade to new PHP Analysis Engine

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 FlyPhpcrTest 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 FlyPhpcr( [] );
19
		$this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object );
20
21
		$this->expectException( '\Aimeos\MW\Filesystem\Exception' );
22
		$object->has( 'test' );
23
	}
24
25
26 View Code Duplication
	public function testGetProviderRoot()
0 ignored issues
show
This method seems to be duplicated in your project.

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.

Loading history...
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