Skip to content
Permalink
Browse files

Fixing failing tests and group test situational fails in console test…

…s. Adding console tests to all tests.
  • Loading branch information...
markstory committed Sep 21, 2010
1 parent 0bb2309 commit 94d738e834d135fbe435072f2b523366bad48e76
@@ -344,7 +344,7 @@ public function customAction() {
$this->hr();
$looksGood = $this->in(__('Look okay?'), array('y','n'), 'y');
if (strtolower($looksGood) == 'y') {
$this->bake($action);
$this->bake($action, ' ');
$this->_stop();
} else {
$this->out(__('Bake Aborted.'));
@@ -72,11 +72,11 @@ class ControllerTaskTest extends CakeTestCase {
public $fixtures = array('core.bake_article', 'core.bake_articles_bake_tag', 'core.bake_comment', 'core.bake_tag');
/**
* startTest method
* setUp method
*
* @return void
*/
public function startTest() {
public function setUp() {
$this->Dispatcher = $this->getMock('ShellDispatcher', array(
'getInput', 'stdout', 'stderr', '_stop', '_initEnvironment', 'clear'
));
@@ -101,11 +101,11 @@ public function startTest() {
}
/**
* endTest method
* teardown method
*
* @return void
*/
public function endTest() {
public function teardown() {
unset($this->Task, $this->Dispatcher);
ClassRegistry::flush();
}
@@ -150,8 +150,9 @@ public function testGetNameValidIndex() {
$this->markTestSkipped('Additional tables detected.');
}
$this->Task->interactive = true;
$this->Task->expects($this->at(5))->method('in')->will($this->returnValue(3));
$this->Task->expects($this->at(7))->method('in')->will($this->returnValue(1));
$this->Task->expects($this->any())->method('in')->will(
$this->onConsecutiveCalls(3, 1)
);
$result = $this->Task->getName('test');
$expected = 'BakeComments';
@@ -511,10 +512,12 @@ function testInteractiveAdminMethodsNotInteractive() {
* @return void
*/
public function testExecuteIntoAll() {
$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;
$count = count($this->Task->listAll('test'));
if ($count != count($this->fixtures)) {
$this->markTestSkipped('Additional tables detected.');
}
if (!defined('ARTICLE_MODEL_CREATED')) {
$this->markTestSkipped('Execute into all could not be run as an Article, Tag or Comment model was already loaded.');
}
$this->Task->connection = 'test';
$this->Task->path = '/my/path/';
@@ -538,10 +541,8 @@ public function testExecuteIntoAll() {
* @return void
*/
public function testExecuteWithController() {
$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;
if (!defined('ARTICLE_MODEL_CREATED')) {
$this->markTestSkipped('Execute with scaffold param requires no Article, Tag or Comment model to be defined');
}
$this->Task->connection = 'test';
$this->Task->path = '/my/path/';
@@ -574,10 +575,8 @@ static function nameVariations() {
* @return void
*/
public function testExecuteWithControllerNameVariations($name) {
$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;
if (!defined('ARTICLE_MODEL_CREATED')) {
$this->markTestSkipped('Execute with scaffold param requires no Article, Tag or Comment model to be defined.');
}
$this->Task->connection = 'test';
$this->Task->path = '/my/path/';
@@ -596,10 +595,8 @@ public function testExecuteWithControllerNameVariations($name) {
* @return void
*/
public function testExecuteWithPublicParam() {
$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;
if (!defined('ARTICLE_MODEL_CREATED')) {
$this->markTestSkipped('Execute with public param requires no Article, Tag or Comment model to be defined.');
}
$this->Task->connection = 'test';
$this->Task->path = '/my/path/';
@@ -619,10 +616,8 @@ public function testExecuteWithPublicParam() {
* @return void
*/
public function testExecuteWithControllerAndBoth() {
$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;
if (!defined('ARTICLE_MODEL_CREATED')) {
$this->markTestSkipped('Execute with controller and both requires no Article, Tag or Comment model to be defined.');
}
$this->Task->Project->expects($this->any())->method('getPrefix')->will($this->returnValue('admin_'));
$this->Task->connection = 'test';
@@ -642,10 +637,8 @@ public function testExecuteWithControllerAndBoth() {
* @return void
*/
public function testExecuteWithControllerAndAdmin() {
$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;
if (!defined('ARTICLE_MODEL_CREATED')) {
$this->markTestSkipped('Execute with controller and admin requires no Article, Tag or Comment model to be defined.');
}
$this->Task->Project->expects($this->any())->method('getPrefix')->will($this->returnValue('admin_'));
$this->Task->connection = 'test';
@@ -389,7 +389,7 @@ function testBakeWithNoTemplate() {
$this->Task->controllerName = 'ViewTaskComments';
$this->Task->controllerPath = 'view_task_comments';
$this->Task->expectNever('createFile');
$this->Task->expects($this->never())->method('createFile');
$this->Task->bake('delete', true);
}
@@ -36,6 +36,10 @@ public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('All Tests');
$path = CORE_TEST_CASES . DS . 'libs' . DS;
$console = CORE_TEST_CASES . DS . 'console' . DS;
$suite->addTestFile($console . 'all_shells.test.php');
$suite->addTestFile($console . 'libs' . DS . 'all_bake_tasks.test.php');
$suite->addTestFile($path . 'all_behaviors.test.php');
$suite->addTestFile($path . 'all_cache_engines.test.php');

0 comments on commit 94d738e

Please sign in to comment.
You can’t perform that action at this time.