Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix failing tests.

When the app did not have the correct models, tests would fail.
  • Loading branch information...
commit 4a0df837830a035e0d2261373782370fcc386163 1 parent 4b13e0a
@markstory markstory authored
Showing with 9 additions and 6 deletions.
  1. +9 −6 lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
View
15 lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
@@ -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',
);
/**
@@ -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;
@@ -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);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.