Updating CakeSchema test case to run in suites. It did not account for additional tables being in the database when it ran.

This commit is contained in:
mark_story 2010-09-19 13:30:36 -04:00
parent 7202a5e398
commit 76ef390d4a

View file

@ -570,9 +570,11 @@ class CakeSchemaTest extends CakeTestCase {
unset($read['tables']['missing']); unset($read['tables']['missing']);
$expected = array('comments', 'datatypes', 'posts', 'posts_tags', 'tags'); $expected = array('comments', 'datatypes', 'posts', 'posts_tags', 'tags');
$this->assertEqual(array_keys($read['tables']), $expected); foreach ($expected as $table) {
foreach ($read['tables'] as $table => $fields) { $this->assertTrue(isset($read['tables'][$table]), 'Missing table ' . $table);
$this->assertEqual(array_keys($fields), array_keys($this->Schema->tables[$table])); }
foreach ($this->Schema->tables as $table => $fields) {
$this->assertEqual(array_keys($fields), array_keys($read['tables'][$table]));
} }
$this->assertEqual( $this->assertEqual(
@ -647,7 +649,7 @@ class CakeSchemaTest extends CakeTestCase {
$this->assertTrue(isset($read['tables']['authors'])); $this->assertTrue(isset($read['tables']['authors']));
$this->assertTrue(isset($read['tables']['test_plugin_comments'])); $this->assertTrue(isset($read['tables']['test_plugin_comments']));
$this->assertTrue(isset($read['tables']['posts'])); $this->assertTrue(isset($read['tables']['posts']));
$this->assertEqual(count($read['tables']), 4); $this->assertTrue(count($read['tables']) >= 4);
App::build(); App::build();
} }