/** * @throws SpoonDatabaseException */ public function testExecute() { // clear all tables if (count($this->db->getTables()) != 0) { $this->db->drop($this->db->getTables()); } // create table users $this->db->execute("\n\t\t\tCREATE TABLE users (\n\t\t\tid INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,\n\t\t\tusername VARCHAR( 255 ) NOT NULL ,\n\t\t\temail VARCHAR( 255 ) NOT NULL ,\n\t\t\tdeveloper ENUM( 'Y', 'N' ) NOT NULL\n\t\t\t) ENGINE = MYISAM;"); }
/** * @depends testExecute */ public function testGetTables() { $this->assertEquals(array('users'), $this->db->getTables()); }
/** * Fully empties the test database * * @param \SpoonDatabase $database */ protected function emptyTestDatabase($database) { foreach ($database->getTables() as $table) { $database->drop($table); } }