mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
b29f805632
commit
08866a90ca
2 changed files with 7 additions and 2 deletions
|
@ -255,7 +255,8 @@ class CakeTestCaseTest extends CakeTestCase {
|
||||||
'return' => 'vars',
|
'return' => 'vars',
|
||||||
'method' => 'get',
|
'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'));
|
$this->assertEqual(array_keys($result['params']['named']), array('var1', 'var2'));
|
||||||
|
|
||||||
$result = $this->Case->testAction('/tests_apps_posts/url_var/gogo/val2', array(
|
$result = $this->Case->testAction('/tests_apps_posts/url_var/gogo/val2', array(
|
||||||
|
@ -272,7 +273,10 @@ class CakeTestCaseTest extends CakeTestCase {
|
||||||
'blue' => 'mana'
|
'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(
|
$result = $this->Case->testAction('/tests_apps_posts/post_var', array(
|
||||||
'return' => 'vars',
|
'return' => 'vars',
|
||||||
|
|
|
@ -377,6 +377,7 @@ class CakeTestCase extends UnitTestCase {
|
||||||
foreach ($this->_fixtures as $fixture) {
|
foreach ($this->_fixtures as $fixture) {
|
||||||
if (in_array($fixture->table, $sources)) {
|
if (in_array($fixture->table, $sources)) {
|
||||||
$fixture->drop($this->db);
|
$fixture->drop($this->db);
|
||||||
|
$fixture->create($this->db);
|
||||||
} elseif (!in_array($fixture->table, $sources)) {
|
} elseif (!in_array($fixture->table, $sources)) {
|
||||||
$fixture->create($this->db);
|
$fixture->create($this->db);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue