Permalink
Browse files

Adding tests for previous commit. Refs #310.

  • Loading branch information...
1 parent 46948dd commit d975dc3190c76067e50e331018552b54f03d5116 @renan renan committed Feb 12, 2010
Showing with 12 additions and 0 deletions.
  1. +12 −0 cake/tests/cases/console/libs/tasks/model.test.php
View
12 cake/tests/cases/console/libs/tasks/model.test.php
@@ -683,6 +683,9 @@ function testBakeWithPlugin() {
$this->Task->expectAt(1, 'createFile', array(
$path, new PatternExpectation('/Article extends ControllerTestAppModel/')));
$this->Task->bake('Article', array(), array());
+
+ $this->assertEqual(count(ClassRegistry::keys()), 0);
+ $this->assertEqual(count(ClassRegistry::mapKeys()), 0);
}
/**
@@ -699,6 +702,9 @@ function testExecuteWithNamedModel() {
$this->Task->setReturnValue('_checkUnitTest', 1);
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article extends AppModel/')));
$this->Task->execute();
+
+ $this->assertEqual(count(ClassRegistry::keys()), 0);
+ $this->assertEqual(count(ClassRegistry::mapKeys()), 0);
}
/**
@@ -732,6 +738,9 @@ function testExecuteIntoAll() {
$this->Task->expectAt(4, 'createFile', array($filename, new PatternExpectation('/class Tag/')));
$this->Task->execute();
+
+ $this->assertEqual(count(ClassRegistry::keys()), 0);
+ $this->assertEqual(count(ClassRegistry::mapKeys()), 0);
}
/**
@@ -762,6 +771,9 @@ function testExecuteIntoInteractive() {
$this->Task->expectOnce('createFile');
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article/')));
$this->Task->execute();
+
+ $this->assertEqual(count(ClassRegistry::keys()), 0);
+ $this->assertEqual(count(ClassRegistry::mapKeys()), 0);
}
/**

0 comments on commit d975dc3

Please sign in to comment.