示例#1
0
 public function testConfig()
 {
     $ctx = get_test_context();
     if ('conf/test.db' != $ctx->db->getDbName()) {
         throw new Exception('Bad database.');
     }
 }
示例#2
0
 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());
     }
 }
示例#3
0
 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)));
 }