QueryTimestampTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testRetrievedTimestampRow() 0 15 1
1
<?php
2
3
namespace evseevnn\Cassandra\Tests;
4
5
use evseevnn\Cassandra;
6
7
class QueryTimestampTest extends Setup\QueryTestCase
8
{
9
	public function testRetrievedTimestampRow()
10
	{
11
		self::$connection->query('CREATE TABLE TimestampTest (p_key text, c_key timestamp, some_data double,
12
		PRIMARY KEY (p_key, c_key));');
13
		self::$connection->query(
14
			'INSERT INTO TimestampTest (p_key, c_key, some_data) VALUES (:p_key, :c_key, :some_data)',
15
			['p_key' => '2014', 'c_key' => 1417302000, 'some_data' => 0.12321]
16
		);
17
		$result = self::$connection->query(
18
			'SELECT * FROM TimestampTest WHERE p_key = :p_key',
19
			['p_key' => '2014']
20
		);
21
		$this->assertFloatEquals(0.12321, $result[0]['some_data']);
22
		$this->assertFloatEquals(1417302000, $result[0]['c_key']);
23
	}
24
}
25