QueryTimestampTest::testRetrievedTimestampRow()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
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