mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
adding a return value to the fixture::truncate() method,
fixing some doc comments in the fixture class git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7236 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
a0ff55926c
commit
ca0fa7b796
1 changed files with 5 additions and 3 deletions
|
@ -127,7 +127,7 @@ class CakeTestFixture extends Object {
|
|||
}
|
||||
}
|
||||
/**
|
||||
* Run before all tests execute, should return SQL statement to create table for this fixture.
|
||||
* Run before all tests execute, should return SQL statement to create table for this fixture could be executed successfully.
|
||||
*
|
||||
* @param object $db An instance of the database object used to create the fixture table
|
||||
* @return boolean True on success, false on failure
|
||||
|
@ -137,6 +137,7 @@ class CakeTestFixture extends Object {
|
|||
if (!isset($this->fields) || empty($this->fields)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->Schema->_build(array($this->table => $this->fields));
|
||||
return ($db->execute($db->createSchema($this->Schema)) !== false);
|
||||
}
|
||||
|
@ -152,7 +153,8 @@ class CakeTestFixture extends Object {
|
|||
return ($db->execute($db->dropSchema($this->Schema)) !== false);
|
||||
}
|
||||
/**
|
||||
* Run before each tests is executed, should return a set of SQL statements to insert records for the table of this fixture.
|
||||
* Run before each tests is executed, should return a set of SQL statements to insert records for the table
|
||||
* of this fixture could be executed successfully.
|
||||
*
|
||||
* @param object $db An instance of the database into which the records will be inserted
|
||||
* @return boolean on success or if there are no records to insert, or false on failure
|
||||
|
@ -181,7 +183,7 @@ class CakeTestFixture extends Object {
|
|||
* @access public
|
||||
*/
|
||||
function truncate(&$db) {
|
||||
$db->truncate($this->table);
|
||||
return $db->truncate($this->table);
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in a new issue