EntityStoreInstallerTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 6
dl 0
loc 39
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 9 1
A testInstallationAndRemoval() 0 11 1
A testStoresPage() 0 3 1
1
<?php
2
3
namespace Tests\Queryr\EntityStore;
4
5
use Doctrine\DBAL\Schema\AbstractSchemaManager;
6
use Queryr\EntityStore\EntityStoreConfig;
7
use Queryr\EntityStore\EntityStoreInstaller;
8
use Tests\Queryr\EntityStore\Fixtures\TestFixtureFactory;
9
10
/**
11
 * @covers Queryr\EntityStore\EntityStoreInstaller
12
 *
13
 * @licence GNU GPL v2+
14
 * @author Jeroen De Dauw < [email protected] >
15
 */
16
class EntityStoreInstallerTest extends \PHPUnit_Framework_TestCase {
17
18
	/**
19
	 * @var EntityStoreInstaller
20
	 */
21
	private $storeInstaller;
22
23
	/**
24
	 * @var AbstractSchemaManager
25
	 */
26
	private $schemaManager;
27
28
	public function setUp() {
29
		$connection = TestFixtureFactory::newInstance()->newConnection();
30
		$this->schemaManager = $connection->getSchemaManager();
31
32
		$this->storeInstaller = new EntityStoreInstaller(
33
			$this->schemaManager,
34
			new EntityStoreConfig( 'kittens_' )
35
		);
36
	}
37
38
	public function testInstallationAndRemoval() {
39
		$this->storeInstaller->install();
40
41
		$this->assertTrue( $this->schemaManager->tablesExist( 'kittens_items' ) );
0 ignored issues
show
Documentation introduced by
'kittens_items' is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
42
		$this->assertTrue( $this->schemaManager->tablesExist( 'kittens_properties' ) );
0 ignored issues
show
Documentation introduced by
'kittens_properties' is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
43
44
		$this->storeInstaller->uninstall();
45
46
		$this->assertFalse( $this->schemaManager->tablesExist( 'kittens_items' ) );
0 ignored issues
show
Documentation introduced by
'kittens_items' is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
47
		$this->assertFalse( $this->schemaManager->tablesExist( 'kittens_properties' ) );
0 ignored issues
show
Documentation introduced by
'kittens_properties' is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
48
	}
49
50
	public function testStoresPage() {
51
		$this->storeInstaller->install();
52
	}
53
54
}
55