Permalink
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...
1 parent d4393e9 commit f8cb20e994b0d8d1b648026908a4f65e9dc07a41 @markstory markstory committed Mar 5, 2010
@@ -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);
}
@@ -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);
@@ -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);
}
/**
@@ -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);
}
/**

0 comments on commit f8cb20e

Please sign in to comment.