public function addTable($tableName, $query = NULL) { if ($query === NULL) { $query = 'SELECT * FROM ' . $tableName; } $this->tables[$tableName] = new PHPUnit_Extensions_Database_DataSet_QueryTable($tableName, $query, $this->databaseConnection); }
/** * assembles the table from the schema and provides it to PHPUnit * * @return PHPUnit_Extensions_Database_DataSet_QueryDataSet assembled schema for PHPUnit **/ public final function getDataSet() { $dataset = new PHPUnit_Extensions_Database_DataSet_QueryDataSet($this->getConnection()); // add all the tables for the project here // THESE TABLES *MUST* BE LISTED IN THE SAME ORDER THEY WERE CREATED!!!! $dataset->addTable("profile"); $dataset->addTable("tweet"); $dataset->addTable("favorite"); return $dataset; }