Permalink
Browse files

Fixing minor issues with tests.

  • Loading branch information...
1 parent 4c76b2f commit 91f90b5c052f7e699051e1881ee93087cbe037b3 @markstory markstory committed Jun 4, 2009
Showing with 7 additions and 6 deletions.
  1. +7 −6 cake/tests/cases/console/libs/tasks/controller.test.php
@@ -169,7 +169,7 @@ function testGetName() {
* @return void
**/
function testDoHelpers() {
- $this->Task->setReturnValueAt(0, 'in', 'n');
+ $this->Task->setReturnValue('in', 'n');
$result = $this->Task->doHelpers();
$this->assertEqual($result, array());
@@ -186,7 +186,7 @@ function testDoHelpers() {
* @return void
**/
function testDoComponents() {
- $this->Task->setReturnValueAt(0, 'in', 'n');
+ $this->Task->setReturnValue('in', 'n');
$result = $this->Task->doComponents();
$this->assertEqual($result, array());
@@ -325,7 +325,7 @@ function testBakeActionsWithNoSessions() {
function testInteractive() {
$this->Task->connection = 'test_suite';
$this->Task->path = '/my/path';
- $this->Task->setReturnValueAt(0, 'in', '1');
+ $this->Task->setReturnValue('in', '1');
$this->Task->setReturnValueAt(1, 'in', 'y'); // build interactive
$this->Task->setReturnValueAt(2, 'in', 'n'); // build no scaffolds
$this->Task->setReturnValueAt(3, 'in', 'y'); // build normal methods
@@ -347,7 +347,7 @@ function testInteractive() {
* @return void
**/
function testExecuteIntoAll() {
- $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'),
+ $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'),
'Execute into all could not be run as an Article, Tag or Comment model was already loaded. %s');
if ($skip) {
return;
@@ -368,7 +368,7 @@ function testExecuteIntoAll() {
* @return void
**/
function testExecuteWithScaffoldParam() {
- $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'),
+ $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'),
'Execute with scaffold param requires no Article, Tag or Comment model to be defined. %s');
if ($skip) {
return;
@@ -396,12 +396,13 @@ function testExecuteWithAdminScaffoldParams() {
if ($skip) {
return;
}
+ Configure::write('Routing.admin', 'admin');
$this->Task->connection = 'test_suite';
$this->Task->path = '/my/path/';
$this->Task->args = array('Articles', 'scaffold', 'admin');
$filename = '/my/path/articles_controller.php';
- $this->Task->expectAt(0, 'createFile', array(
+ $this->Task->expect('createFile', array(
$filename, new PatternExpectation('/admin_index/')
));

0 comments on commit 91f90b5

Please sign in to comment.