Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding tests for previous commit. Refs #310.
  • Loading branch information
renan committed Feb 12, 2010
1 parent 46948dd commit d975dc3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cake/tests/cases/console/libs/tasks/model.test.php
Expand Up @@ -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);
}

/**
Expand All @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit d975dc3

Please sign in to comment.