Passed
Push — master ( 894e98...cda682 )
by Aimeos
18:42 queued 10:10
created

FlyPhpcrTest::testGetProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Aimeos\Base\Filesystem;
4
5
6
class FlyPhpcrTest extends \PHPUnit\Framework\TestCase
7
{
8
	protected function setUp() : void
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\Base\Filesystem\Iface::class, $object );
20
21
		$this->expectException( \Aimeos\Base\Filesystem\Exception::class );
22
		$object->has( 'test' );
23
	}
24
25
26
	public function testGetProviderRoot()
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\Base\Filesystem\Iface::class, $object );
39
40
		$this->expectException( \PHPCR\RepositoryException::class );
0 ignored issues
show
Bug introduced by
The type PHPCR\RepositoryException was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
41
		$object->has( 'test' );
42
	}
43
}
44