Updating tests in cake_test_case test, so they run in group test.

Fixing issue in cakeTestCase when running tests with fixtures. Fixture tables were not being created if $test DB config and $default DB were using the same database. Closes #5519

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7698 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mark_story 2008-10-04 16:35:53 +00:00
parent b29f805632
commit 08866a90ca
2 changed files with 7 additions and 2 deletions

View file

@ -255,7 +255,8 @@ class CakeTestCaseTest extends CakeTestCase {
'return' => 'vars',
'method' => 'get',
));
$this->assertEqual(array_keys($result['params']['url']), array('case', 'output', 'url'));
$this->assertTrue(isset($result['params']['url']['url']));
$this->assertTrue(isset($result['params']['url']['output']));
$this->assertEqual(array_keys($result['params']['named']), array('var1', 'var2'));
$result = $this->Case->testAction('/tests_apps_posts/url_var/gogo/val2', array(
@ -272,7 +273,10 @@ class CakeTestCaseTest extends CakeTestCase {
'blue' => 'mana'
)
));
$this->assertEqual(array_keys($result['params']['url']), array('case', 'output', 'red', 'blue', 'url'));
$this->assertTrue(isset($result['params']['url']['output']));
$this->assertTrue(isset($result['params']['url']['red']));
$this->assertTrue(isset($result['params']['url']['blue']));
$this->assertTrue(isset($result['params']['url']['url']));
$result = $this->Case->testAction('/tests_apps_posts/post_var', array(
'return' => 'vars',

View file

@ -377,6 +377,7 @@ class CakeTestCase extends UnitTestCase {
foreach ($this->_fixtures as $fixture) {
if (in_array($fixture->table, $sources)) {
$fixture->drop($this->db);
$fixture->create($this->db);
} elseif (!in_array($fixture->table, $sources)) {
$fixture->create($this->db);
}