Completed
Push — master ( 3aaa57...3b1bb7 )
by Aimeos
02:24
created

FlyPhpcrTest::setUp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 2
eloc 3
nc 2
nop 0
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( array() );
19
		$this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object );
20
21
		$this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' );
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\MW\Filesystem\Iface', $object );
39
40
		$this->setExpectedException( '\PHPCR\RepositoryException' );
41
		$object->has( 'test' );
42
	}
43
}
44