示例#1
0
 public function testLoadTestData()
 {
     $builder = new bruteDbBuilder();
     $builder->createDb();
     $builder->createTables();
     $builder->loadTestData();
     $count = $this->dbAdapter->fetchOne('SELECT count( 1 ) as count FROM campaigns WHERE id=?;', 9999);
     $this->assertEquals(1, $count);
     $count = $this->dbAdapter->fetchOne('SELECT count( 1 ) as count FROM media WHERE id=?;', 9999);
     $this->assertEquals(1, $count);
     $count = $this->dbAdapter->fetchOne('SELECT count( 1 ) as count FROM sessions WHERE id=?;', 9999);
     $this->assertEquals(1, $count);
     $count = $this->dbAdapter->fetchOne('SELECT count( 1 ) as count FROM users WHERE id=?;', 9999);
     $this->assertEquals(1, $count);
     $count = $this->dbAdapter->fetchOne('SELECT count( 1 ) as count FROM tags WHERE id=?;', 9999);
     $this->assertEquals(1, $count);
     $count = $this->dbAdapter->fetchOne('SELECT count( 1 ) as count FROM tags_xref WHERE tag=? AND type=? AND entity=?;', array(9999, 'session', 9999));
     $this->assertEquals(1, $count);
 }
示例#2
0
<?php

require_once 'bruteDbBuilder.php';
$builder = new bruteDbBuilder();
//create database
$builder->createDb();
//create tables
$builder->createTables();
//load test data
$builder->loadTestData();