Skip to content

Commit

Permalink
All tests passing on postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Sep 3, 2011
1 parent 74ba030 commit 8897335
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php
Expand Up @@ -468,7 +468,7 @@ public function testDrop() {
$this->assertTrue($return);

$return = $Fixture->drop($this->criticDb);
$this->assertFalse($return);
$this->assertTrue($return);

unset($Fixture->fields);
$return = $Fixture->drop($this->criticDb);
Expand Down
24 changes: 12 additions & 12 deletions lib/Cake/Test/Fixture/AcoFixture.php
Expand Up @@ -52,17 +52,17 @@ class AcoFixture extends CakeTestFixture {
* @var array
*/
public $records = array(
array('id' => 1, 'parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 24),
array('id' => 2, 'parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Controller1', 'lft' => 2, 'rght' => 9),
array('id' => 3, 'parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 3, 'rght' => 6),
array('id' => 4, 'parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 4, 'rght' => 5),
array('id' => 5, 'parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action2', 'lft' => 7, 'rght' => 8),
array('id' => 6, 'parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Controller2','lft' => 10, 'rght' => 17),
array('id' => 7, 'parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 11, 'rght' => 14),
array('id' => 8, 'parent_id' => 7, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 12, 'rght' => 13),
array('id' => 9, 'parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'action2', 'lft' => 15, 'rght' => 16),
array('id' => 10, 'parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Users', 'lft' => 18, 'rght' => 23),
array('id' => 11, 'parent_id' => 9, 'model' => null, 'foreign_key' => null, 'alias' => 'Users', 'lft' => 19, 'rght' => 22),
array('id' => 12, 'parent_id' => 10, 'model' => null, 'foreign_key' => null, 'alias' => 'view', 'lft' => 20, 'rght' => 21),
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 24),
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Controller1', 'lft' => 2, 'rght' => 9),
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 3, 'rght' => 6),
array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 4, 'rght' => 5),
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action2', 'lft' => 7, 'rght' => 8),
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Controller2','lft' => 10, 'rght' => 17),
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 11, 'rght' => 14),
array('parent_id' => 7, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 12, 'rght' => 13),
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'action2', 'lft' => 15, 'rght' => 16),
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Users', 'lft' => 18, 'rght' => 23),
array('parent_id' => 9, 'model' => null, 'foreign_key' => null, 'alias' => 'Users', 'lft' => 19, 'rght' => 22),
array('parent_id' => 10, 'model' => null, 'foreign_key' => null, 'alias' => 'view', 'lft' => 20, 'rght' => 21),
);
}
20 changes: 13 additions & 7 deletions lib/Cake/TestSuite/Fixture/CakeTestFixture.php
Expand Up @@ -168,10 +168,12 @@ public function create($db) {
}
}
$this->Schema->build(array($this->table => $this->fields));

return (
$db->execute($db->createSchema($this->Schema), array('log' => false)) !== false
);
try {
$db->execute($db->createSchema($this->Schema), array('log' => false));
} catch (Exception $e) {
return false;
}
return true;
}

/**
Expand All @@ -185,9 +187,13 @@ public function drop($db) {
return false;
}
$this->Schema->build(array($this->table => $this->fields));
return (
$db->execute($db->dropSchema($this->Schema), array('log' => false)) !== false
);
try {

$db->execute($db->dropSchema($this->Schema), array('log' => false));
} catch (Exception $e) {
return false;
}
return true;
}

/**
Expand Down

0 comments on commit 8897335

Please sign in to comment.