DatabaseTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
c 2
b 0
f 1
lcom 0
cbo 2
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testConnectionSetup() 0 6 1
A testBindParamArray() 0 15 1
1
<?php
2
namespace Kineo\Test;
3
	
4
use Symfony\Component\HttpFoundation\Response;
5
use Kineo\Component\Database;
6
7
class DatabaseTest extends \PHPUnit_Framework_TestCase
8
{
9
	public function testConnectionSetup()
10
	{
11
		$database = new Database();
12
		
13
		$this->assertInstanceOf('\PDO', $database);
14
	}
15
	
16
	public function testBindParamArray()
17
	{
18
		$bindArray = array('param' => 4);
19
		
20
		Database::bindParamArray('test', array(4,6,8), $bindArray);
21
		
22
		$expected = array(
23
			'param' => 4,
24
			'test0' => 4,
25
			'test1' => 6,
26
			'test2' => 8
27
		);
28
		
29
		$this->assertEquals($expected, $bindArray);
30
	}
31
}
32