QueryTestCase   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUpBeforeClass() 0 10 1
A tearDownAfterClass() 0 4 1
A assertFloatEquals() 0 4 1
1
<?php
2
/**
3
 * Created by IntelliJ IDEA.
4
 * User: lfronius
5
 * Date: 09/10/14
6
 * Time: 16:59
7
 * To change this template use File | Settings | File Templates.
8
 */
9
10
namespace evseevnn\Cassandra\Tests\Setup;
11
12
use evseevnn\Cassandra;
13
14
abstract class QueryTestCase extends \PHPUnit_Framework_TestCase
15
{
16
17
		protected static $connection;
18
19
		public static function setUpBeforeClass()
20
		{
21
				self::$connection = new Cassandra\Database(['127.0.0.1:9042']);
22
				self::$connection->connect();
23
				self::$connection->query("DROP KEYSPACE IF EXISTS testkeyspace;");
24
				self::$connection->query(
25
						"CREATE KEYSPACE testkeyspace WITH replication = {   'class': 'SimpleStrategy',   'replication_factor': '1' };"
26
				);
27
				self::$connection->query("USE testkeyspace;");
28
		}
29
30
		public static function tearDownAfterClass()
31
		{
32
				self::$connection->query("DROP KEYSPACE testkeyspace;");
33
		}
34
35
	    public static function assertFloatEquals($expected, $actual)
36
	    {
37
		        self::assertEquals($expected, $actual, '', 0.00001);
38
	    }
39
40
}