public function testConfig() { $ctx = get_test_context(); if ('conf/test.db' != $ctx->db->getDbName()) { throw new Exception('Bad database.'); } }
public function testInternalTables() { $tables = array('node', 'node__access', 'node__rel'); $ctx = get_test_context(); foreach ($tables as $table) { $c = $ctx->db->fetch("SELECT COUNT(*) FROM `{$table}`"); $t = new TableInfo($ctx->db, $table); $this->assertTrue($t->exists()); } }
public function testCountDeletedNodes() { $db = get_test_context()->db; $count = $db->getResult("SELECT COUNT(*) FROM `node` WHERE `class` = 'type' AND `deleted` = 1"); $this->assertEquals($count, Node::count(array('class' => 'type', 'deleted' => 1))); }