Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Passing interactive property to inner tasks. Inner tasks now share th…

…e parent interactive setting making things more consistent. Fixes #423
  • Loading branch information...
commit f8cb20e994b0d8d1b648026908a4f65e9dc07a41 1 parent d4393e9
@markstory markstory authored
View
1  cake/console/libs/tasks/controller.php
@@ -330,6 +330,7 @@ function bake($controllerName, $actions = '', $helpers = null, $components = nul
function bakeTest($className) {
$this->Test->plugin = $this->plugin;
$this->Test->connection = $this->connection;
+ $this->Test->interactive = $this->interactive;
return $this->Test->bake('Controller', $className);
}
View
2  cake/console/libs/tasks/model.php
@@ -752,6 +752,7 @@ function bake($name, $data = array()) {
* @access private
*/
function bakeTest($className) {
+ $this->Test->interactive = $this->interactive;
$this->Test->plugin = $this->plugin;
$this->Test->connection = $this->connection;
return $this->Test->bake('Model', $className);
@@ -911,6 +912,7 @@ function help() {
* @see FixtureTask::bake
*/
function bakeFixture($className, $useTable = null) {
+ $this->Fixture->interactive = $this->interactive;
$this->Fixture->connection = $this->connection;
$this->Fixture->plugin = $this->plugin;
$this->Fixture->bake($className, $useTable);
View
2  cake/tests/cases/console/libs/tasks/controller.test.php
@@ -389,12 +389,14 @@ function testBakeActionsWithNoSessions() {
function testBakeTest() {
$this->Task->plugin = 'ControllerTest';
$this->Task->connection = 'test_suite';
+ $this->Task->interactive = false;
$this->Task->Test->expectOnce('bake', array('Controller', 'Articles'));
$this->Task->bakeTest('Articles');
$this->assertEqual($this->Task->plugin, $this->Task->Test->plugin);
$this->assertEqual($this->Task->connection, $this->Task->Test->connection);
+ $this->assertEqual($this->Task->interactive, $this->Task->Test->interactive);
}
/**
View
6 cake/tests/cases/console/libs/tasks/model.test.php
@@ -487,11 +487,14 @@ function testDoAssociationsNonInteractive() {
* @access public
*/
function testBakeFixture() {
+ $this->Task->plugin = 'test_plugin';
+ $this->Task->interactive = true;
$this->Task->Fixture->expectAt(0, 'bake', array('Article', 'articles'));
$this->Task->bakeFixture('Article', 'articles');
$this->assertEqual($this->Task->plugin, $this->Task->Fixture->plugin);
$this->assertEqual($this->Task->connection, $this->Task->Fixture->connection);
+ $this->assertEqual($this->Task->interactive, $this->Task->Fixture->interactive);
}
/**
@@ -501,11 +504,14 @@ function testBakeFixture() {
* @access public
*/
function testBakeTest() {
+ $this->Task->plugin = 'test_plugin';
+ $this->Task->interactive = true;
$this->Task->Test->expectAt(0, 'bake', array('Model', 'Article'));
$this->Task->bakeTest('Article');
$this->assertEqual($this->Task->plugin, $this->Task->Test->plugin);
$this->assertEqual($this->Task->connection, $this->Task->Test->connection);
+ $this->assertEqual($this->Task->interactive, $this->Task->Test->interactive);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.