Skip to content

Commit

Permalink
Fix failing tests.
Browse files Browse the repository at this point in the history
When the app did not have the correct models, tests would fail.
  • Loading branch information
markstory committed Mar 5, 2013
1 parent 4b13e0a commit 4a0df83
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
Expand Up @@ -93,8 +93,9 @@ class SchemaShellTest extends CakeTestCase {
*
* @var array
*/
public $fixtures = array('core.article', 'core.user', 'core.post', 'core.auth_user', 'core.author',
'core.comment', 'core.test_plugin_comment'
public $fixtures = array(
'core.article', 'core.user', 'core.post', 'core.auth_user', 'core.author',
'core.comment', 'core.test_plugin_comment', 'core.aco', 'core.aro', 'core.aros_aco',
);

/**
Expand Down Expand Up @@ -405,9 +406,11 @@ public function testGenerateModels() {
public function testGenerateExclude() {
$this->db->cacheSources = false;
$this->Shell->params = array(
'connection' => 'test',
'force' => false,
'models' => 'Aro, Aco, Permission',
'overwrite' => true,
'exclude' => 'acos,aros'
'exclude' => 'acos, aros',
);
$this->Shell->startup();
$this->Shell->Schema->path = TMP . 'tests' . DS;
Expand All @@ -416,9 +419,9 @@ public function testGenerateExclude() {
$this->file = new File(TMP . 'tests' . DS . 'schema.php');
$contents = $this->file->read();

$this->assertNotRegExp('/public \$aros = array\(/', $contents);
$this->assertNotRegExp('/public \$acos = array\(/', $contents);
$this->assertRegExp('/public \$aros_acos = array\(/', $contents);
$this->assertNotContains('public $acos = array(', $contents);
$this->assertNotContains('public $aros = array(', $contents);
$this->assertContains('public $aros_acos = array(', $contents);
}

/**
Expand Down

0 comments on commit 4a0df83

Please sign in to comment.