diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index c18851338..fc81eec16 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -1,5 +1,4 @@ args)) { + $this->Model->interactive = true; $name = $this->Model->getName($this->connection); } - + foreach (array('Model', 'Controller', 'View') as $task) { $this->{$task}->connection = $this->connection; $this->{$task}->interactive = false; @@ -188,10 +185,6 @@ class BakeShell extends Shell { } else { $this->err(__('Bake All could not continue without a valid model', true)); } - - if (empty($this->args)) { - $this->all(); - } $this->_stop(); } diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 514089e72..46828a750 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -1,5 +1,4 @@ hr(); } - /** * Interact with the user and ask about which methods (admin or regular they want to bake) * @@ -264,7 +255,6 @@ class ControllerTask extends Shell { ); return array($wannaBakeCrud, $wannaBakeAdminCrud); } - /** * Bake scaffold actions * @@ -296,8 +286,6 @@ class ControllerTask extends Shell { $actions = $this->Template->generate('actions', 'controller_actions'); return $actions; } - - /** * Assembles and writes a Controller file * @@ -326,7 +314,6 @@ class ControllerTask extends Shell { } return false; } - /** * Assembles and writes a unit test file * @@ -339,7 +326,6 @@ class ControllerTask extends Shell { $this->Test->connection = $this->connection; return $this->Test->bake('Controller', $className); } - /** * Interact with the user and get a list of additional helpers * @@ -363,7 +349,6 @@ class ControllerTask extends Shell { __("Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'", true) ); } - /** * Common code for property choice handling. * @@ -381,7 +366,6 @@ class ControllerTask extends Shell { } return array_filter($property); } - /** * Outputs and gets the list of possible controllers from database * @@ -408,7 +392,6 @@ class ControllerTask extends Shell { } return $this->__tables; } - /** * Forces the user to specify the controller he wants to bake, and returns the selected controller name. * @@ -441,7 +424,6 @@ class ControllerTask extends Shell { } return $controllerName; } - /** * Displays help contents * @@ -474,4 +456,4 @@ class ControllerTask extends Shell { $this->_stop(); } } -?> +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index e93a8312b..42c0a42af 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -1,5 +1,4 @@ path . 'database.php'; return $this->createFile($filename, $out); } - /** * Get a user specified Connection name * @@ -361,6 +356,5 @@ class DbConfigTask extends Shell { } return $useDbConfig; } - } ?> \ No newline at end of file diff --git a/cake/console/libs/tasks/extract.php b/cake/console/libs/tasks/extract.php index 7918e8cd7..552eb8497 100644 --- a/cake/console/libs/tasks/extract.php +++ b/cake/console/libs/tasks/extract.php @@ -1,5 +1,4 @@ bake($model); } } - /** * Bake All the Fixtures at once. Will only bake fixtures for models that exist. * @@ -105,7 +100,6 @@ class FixtureTask extends Shell { $this->bake($model); } } - /** * Interactive baking function * @@ -144,7 +138,6 @@ class FixtureTask extends Shell { } return $options; } - /** * Assembles and writes a Fixture file * @@ -199,7 +192,6 @@ class FixtureTask extends Shell { $out = $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import', 'fields')); return $out; } - /** * Generate the fixture file, and write to disk * @@ -226,7 +218,6 @@ class FixtureTask extends Shell { $this->createFile($path . $filename, $content); return $content; } - /** * Generates a string representation of a schema. * @@ -257,7 +248,6 @@ class FixtureTask extends Shell { $out .= "\n\t)"; return $out; } - /** * Generate String representation of Records * @@ -322,7 +312,6 @@ class FixtureTask extends Shell { $out .= "\t)"; return $out; } - /** * Displays help contents * @@ -344,4 +333,4 @@ class FixtureTask extends Shell { $this->_stop(); } } -?> +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 23c04563a..d436748d9 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -1,5 +1,4 @@ $className, 'ds' => $this->connection)); return $object; } - /** * Generate a key value list of options and a prompt. * @@ -172,7 +158,6 @@ class ModelTask extends Shell { } return $choice - 1; } - /** * Handles interactive baking * @@ -265,7 +250,6 @@ class ModelTask extends Shell { return false; } } - /** * Print out all the associations of a particular type * @@ -283,7 +267,6 @@ class ModelTask extends Shell { } } } - /** * Finds a primary Key in a list of fields. * @@ -437,7 +420,6 @@ class ModelTask extends Shell { } return $validate; } - /** * Handles associations * @@ -484,7 +466,6 @@ class ModelTask extends Shell { } return $associations; } - /** * Find belongsTo relations and add them to the associations list. * @@ -513,7 +494,6 @@ class ModelTask extends Shell { } return $associations; } - /** * Find the hasOne and HasMany relations and add them to associations list * @@ -556,7 +536,6 @@ class ModelTask extends Shell { } return $associations; } - /** * Find the hasAndBelongsToMany relations and add them to associations list * @@ -596,7 +575,6 @@ class ModelTask extends Shell { } return $associations; } - /** * Interact with the user and confirm associations. * @@ -624,7 +602,6 @@ class ModelTask extends Shell { } return $associations; } - /** * Interact with the user and generate additional non-conventional associations * @@ -691,7 +668,6 @@ class ModelTask extends Shell { } return $associations; } - /** * Finds all possible keys to use on custom associations. * @@ -748,7 +724,6 @@ class ModelTask extends Shell { $this->createFile($filename, $out); return $out; } - /** * Assembles and writes a unit test file * @@ -760,7 +735,6 @@ class ModelTask extends Shell { $this->Test->connection = $this->connection; return $this->Test->bake('Model', $className); } - /** * outputs the a list of possible models or controllers from database * @@ -781,7 +755,6 @@ class ModelTask extends Shell { } return $this->__tables; } - /** * Interact with the user to determine the table name of a particular model * @@ -808,7 +781,6 @@ class ModelTask extends Shell { } return $useTable; } - /** * Get an Array of all the tables in the supplied connection * will halt the script if no tables are found. @@ -838,7 +810,6 @@ class ModelTask extends Shell { } return $tables; } - /** * Forces the user to specify the model he wants to bake, and returns the selected model name. * @@ -870,7 +841,6 @@ class ModelTask extends Shell { } return $currentModelName; } - /** * Displays help contents * @@ -893,7 +863,6 @@ class ModelTask extends Shell { $this->out(""); $this->_stop(); } - /** * Interact with FixtureTask to automatically bake fixtures when baking models. * diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 5e50bb877..e169e7c04 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -1,5 +1,4 @@ path = APP . 'plugins' . DS; } - /** * Execution method always used for tasks * @@ -99,7 +92,6 @@ class PluginTask extends Shell { } } } - /** * Interactive interface * @@ -115,7 +107,6 @@ class PluginTask extends Shell { $this->err(sprintf(__("An error occured trying to bake: %s in %s", true), $plugin, $this->path . $pluginPath)); } } - /** * Bake the plugin, create directories and files * @@ -200,7 +191,6 @@ class PluginTask extends Shell { return true; } - /** * find and change $this->path to the user selection * @@ -221,7 +211,6 @@ class PluginTask extends Shell { } $this->path = $pathOptions[$choice - 1]; } - /** * Help * diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index 7cc635cf5..fda6a7cf7 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -19,7 +19,6 @@ * @since CakePHP(tm) v 1.2 * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ - /** * Task class for creating new project apps and plugins * diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php index ac01e9e30..fd01e90d5 100644 --- a/cake/console/libs/tasks/template.php +++ b/cake/console/libs/tasks/template.php @@ -2,7 +2,6 @@ /** * Template Task can generate templated output Used in other Tasks * - * * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) @@ -14,7 +13,7 @@ * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org * @package cake - * @subpackage cake. + * @subpackage cake.console.libs.tasks * @since CakePHP(tm) v 1.3 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ @@ -25,7 +24,6 @@ class TemplateTask extends Shell { * @var array **/ var $templateVars = array(); - /** * Paths to look for templates on. * Contains a list of $theme => $path @@ -33,7 +31,6 @@ class TemplateTask extends Shell { * @var array **/ var $templatePaths = array(); - /** * Initialize callback. Setup paths for the template task. * @@ -43,7 +40,6 @@ class TemplateTask extends Shell { function initialize() { $this->templatePaths = $this->_findThemes(); } - /** * Find the paths to all the installed shell themes in the app. * @@ -68,7 +64,6 @@ class TemplateTask extends Shell { } return $themes; } - /** * Set variable values to the template scope * @@ -97,7 +92,6 @@ class TemplateTask extends Shell { $this->templateVars[$name] = $value; } } - /** * Runs the template * @@ -126,7 +120,6 @@ class TemplateTask extends Shell { } return ''; } - /** * Find the theme name for the current operation. * If there is only one theme in $templatePaths it will be used. @@ -161,7 +154,6 @@ class TemplateTask extends Shell { $this->Dispatch->params['theme'] = $themeNames[$index - 1]; return $indexedPaths[$index]; } - /** * Find a template inside a directory inside a path. * Will scan all other theme dirs if the template is not found in the first directory. @@ -187,5 +179,5 @@ class TemplateTask extends Shell { $this->_stop(); return false; } - -} \ No newline at end of file +} +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 6a7b6e732..54668a843 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -1,27 +1,21 @@ getClassName($type); return $this->bake($type, $className); } - /** * Completes final steps for generating data to create test case. * @@ -185,7 +173,6 @@ class TestTask extends Shell { } return $this->classTypes[$selection - 1]; } - /** * Get the user chosen Class name for the chosen type * @@ -206,7 +193,6 @@ class TestTask extends Shell { } return $selection; } - /** * Checks whether the chosen type can find its own fixtures. * Currently only model, and controller are supported @@ -217,7 +203,6 @@ class TestTask extends Shell { $type = strtolower($type); return ($type == 'controller' || $type == 'model'); } - /** * Check if a class with the given type is loaded or can be loaded. * @@ -226,7 +211,6 @@ class TestTask extends Shell { function isLoadableClass($type, $class) { return App::import($type, $class); } - /** * Construct an instance of the class to be tested. * So that fixtures can be detected @@ -244,7 +228,6 @@ class TestTask extends Shell { } return $instance; } - /** * Gets the real class name from the cake short form. * @@ -256,7 +239,6 @@ class TestTask extends Shell { } return $class . $type; } - /** * Get methods declared in the class given. * No parent methods will be returned @@ -276,7 +258,6 @@ class TestTask extends Shell { } return $out; } - /** * Generate the list of fixtures that will be required to run this test based on * loaded models. @@ -293,7 +274,6 @@ class TestTask extends Shell { } return array_values($this->_fixtures); } - /** * Process a model recursively and pull out all the * model names converting them to fixture names. @@ -317,7 +297,6 @@ class TestTask extends Shell { } } } - /** * Process all the models attached to a controller * and generate a fixture list. @@ -335,7 +314,6 @@ class TestTask extends Shell { $this->_processModel($subject->{$model}); } } - /** * Add classname to the fixture list. * Sets the app. or plugin.plugin_name. prefix. @@ -353,7 +331,6 @@ class TestTask extends Shell { $fixture = $prefix . Inflector::underscore($name); $this->_fixtures[$name] = $fixture; } - /** * Interact with the user to get additional fixtures they want to use. * @@ -370,7 +347,6 @@ class TestTask extends Shell { $this->_fixtures = array_merge($this->_fixtures, $fixtures); return $fixtures; } - /** * Is a mock class required for this type of test? * Controllers require a mock class. @@ -381,7 +357,6 @@ class TestTask extends Shell { $type = strtolower($type); return $type == 'controller'; } - /** * Generate a constructor code snippet for the type and classname * @@ -397,7 +372,6 @@ class TestTask extends Shell { } return "new $fullClassName()\n"; } - /** * make the filename for the test case. resolve the suffixes for controllers * and get the plugin path if needed. diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 7634efff4..ba5f1c37e 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -1,5 +1,4 @@ Dispatch =& new BakeShellMockShellDispatcher(); $this->Shell =& new MockBakeShell(); - $this->Shell->Dispatch =& $this->Dispatcher; + $this->Shell->Dispatch =& $this->Dispatch; $this->Shell->Dispatch->shellPaths = App::path('shells'); } +/** + * endTest method + * + * @return void + **/ + function endTest() { + unset($this->Dispatch, $this->Shell); + } /** * test bake all * @@ -97,13 +105,13 @@ class BakeShellTestCase extends CakeTestCase { $this->Shell->View->expectOnce('execute'); $this->Shell->expectAt(0, 'out', array('Bake All')); - $this->Shell->expectAt(1, 'out', array('Article Model was baked.')); - $this->Shell->expectAt(2, 'out', array('Article Controller was baked.')); - $this->Shell->expectAt(3, 'out', array('Article Views were baked.')); + $this->Shell->expectAt(1, 'out', array('User Model was baked.')); + $this->Shell->expectAt(2, 'out', array('User Controller was baked.')); + $this->Shell->expectAt(3, 'out', array('User Views were baked.')); $this->Shell->expectAt(4, 'out', array('Bake All complete')); $this->Shell->params = array(); - $this->Shell->args = array('Article', 'exitvalue'); + $this->Shell->args = array('User'); $this->Shell->all(); } } \ No newline at end of file diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 125eef72a..f43ce27b5 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -2,7 +2,6 @@ /** * ControllerTask Test Case * - * * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) @@ -88,9 +87,8 @@ class ControllerTaskTest extends CakeTestCase { * @var array **/ var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); - /** - * setUp method + * startTest method * * @return void * @access public @@ -106,9 +104,8 @@ class ControllerTaskTest extends CakeTestCase { $this->Task->Project =& new ControllerMockProjectTask($this->Task->Dispatch); $this->Task->Test =& new ControllerMockTestTask(); } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -117,7 +114,6 @@ class ControllerTaskTest extends CakeTestCase { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } - /** * test ListAll * @@ -146,7 +142,6 @@ class ControllerTaskTest extends CakeTestCase { $expected = array('articles', 'articles_tags', 'comments', 'tags'); $this->assertEqual($result, $expected); } - /** * Test that getName interacts with the user and returns the controller name. * @@ -173,7 +168,6 @@ class ControllerTaskTest extends CakeTestCase { $result = $this->Task->getName('test_suite'); $this->Task->expectOnce('err'); } - /** * test helper interactions * @@ -196,7 +190,6 @@ class ControllerTaskTest extends CakeTestCase { $expected = array('Javascript', 'Ajax', 'CustomOne'); $this->assertEqual($result, $expected); } - /** * test component interactions * @@ -219,7 +212,6 @@ class ControllerTaskTest extends CakeTestCase { $expected = array('RequestHandler', 'Security'); $this->assertEqual($result, $expected); } - /** * test Confirming controller user interaction * @@ -237,7 +229,6 @@ class ControllerTaskTest extends CakeTestCase { $this->Task->expectAt(4, 'out', array("Components:\n\tAcl, Auth")); $this->Task->confirmController($controller, $scaffold, $helpers, $components); } - /** * test the bake method * @@ -260,7 +251,6 @@ class ControllerTaskTest extends CakeTestCase { $this->assertNoPattern('/helpers/', $result); $this->assertNoPattern('/components/', $result); } - /** * test bake() with a -plugin param * @@ -282,7 +272,6 @@ class ControllerTaskTest extends CakeTestCase { $path, new PatternExpectation('/ArticlesController extends ControllerTestAppController/'))); $this->Task->bake('Articles', '--actions--', array(), array(), array()); } - /** * test that bakeActions is creating the correct controller Code. (Using sessions) * @@ -325,7 +314,6 @@ class ControllerTaskTest extends CakeTestCase { $this->assertTrue(strpos($result, 'function admin_edit($id = null)') !== false); $this->assertTrue(strpos($result, 'function admin_delete($id = null)') !== false); } - /** * Test baking with Controller::flash() or no sessions. * @@ -360,7 +348,6 @@ class ControllerTaskTest extends CakeTestCase { $this->assertTrue(strpos($result, 'if ($this->Article->del($id))') !== false); $this->assertTrue(strpos($result, "\$this->flash(__('Article deleted', true), array('action' => 'index'))") !== false); } - /** * test baking a test * @@ -376,7 +363,6 @@ class ControllerTaskTest extends CakeTestCase { $this->assertEqual($this->Task->plugin, $this->Task->Test->plugin); $this->assertEqual($this->Task->connection, $this->Task->Test->connection); } - /** * test Interactive mode. * @@ -400,7 +386,6 @@ class ControllerTaskTest extends CakeTestCase { $filename = '/my/path/articles_controller.php'; $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticlesController/'))); } - /** * test that execute runs all when the first arg == all * @@ -425,7 +410,6 @@ class ControllerTaskTest extends CakeTestCase { $this->Task->execute(); } - /** * test that `cake bake controller foo scaffold` works. * @@ -448,7 +432,6 @@ class ControllerTaskTest extends CakeTestCase { $this->Task->execute(); } - /** * test that `cake bake controller foo scaffold admin` works * diff --git a/cake/tests/cases/console/libs/tasks/db_config.test.php b/cake/tests/cases/console/libs/tasks/db_config.test.php index 45dde61a7..bfd999e0d 100644 --- a/cake/tests/cases/console/libs/tasks/db_config.test.php +++ b/cake/tests/cases/console/libs/tasks/db_config.test.php @@ -2,7 +2,6 @@ /** * DBConfigTask Test Case * - * * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) @@ -74,9 +73,8 @@ class TEST_DATABASE_CONFIG { * @subpackage cake.tests.cases.console.libs.tasks */ class DbConfigTaskTest extends CakeTestCase { - /** - * setUp method + * startTest method * * @return void * @access public @@ -90,9 +88,8 @@ class DbConfigTaskTest extends CakeTestCase { $this->Task->params['working'] = rtrim(APP, '/'); $this->Task->databaseClassName = 'TEST_DATABASE_CONFIG'; } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -101,7 +98,6 @@ class DbConfigTaskTest extends CakeTestCase { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } - /** * Test the getConfig method. * @@ -112,7 +108,6 @@ class DbConfigTaskTest extends CakeTestCase { $result = $this->Task->getConfig(); $this->assertEqual($result, 'otherOne'); } - /** * test that initialize sets the path up. * diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 9f4a540a9..2981ab88f 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -2,8 +2,6 @@ /** * FixtureTask Test case * - * - * * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) @@ -15,7 +13,7 @@ * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org * @package cake - * @subpackage cake. + * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP(tm) v 1.3 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ @@ -63,7 +61,7 @@ class FixtureTaskTest extends CakeTestCase { **/ var $fixtures = array('core.article', 'core.comment'); /** - * setUp method + * startTest method * * @return void * @access public @@ -78,7 +76,7 @@ class FixtureTaskTest extends CakeTestCase { $this->Task->Template->initialize(); } /** - * tearDown method + * endTest method * * @return void * @access public @@ -132,7 +130,6 @@ class FixtureTaskTest extends CakeTestCase { $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/'))); $this->Task->execute(); } - /** * test that execute runs all() when args[0] = all * @@ -152,7 +149,6 @@ class FixtureTaskTest extends CakeTestCase { $this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class CommentFixture/'))); $this->Task->execute(); } - /** * test interactive mode of execute * diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 186ae003c..540414d87 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -1,5 +1,4 @@ Task->Fixture =& new MockModelTaskFixtureTask(); $this->Task->Test =& new MockModelTaskFixtureTask(); } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -99,7 +93,6 @@ class ModelTaskTest extends CakeTestCase { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } - /** * Test that listAll scans the database connection and lists all the tables in it.s * @@ -126,7 +119,6 @@ class ModelTaskTest extends CakeTestCase { $expected = array('articles', 'articles_tags', 'category_threads', 'comments', 'tags'); $this->assertEqual($result, $expected); } - /** * Test that getName interacts with the user and returns the model name. * @@ -153,7 +145,6 @@ class ModelTaskTest extends CakeTestCase { $result = $this->Task->getName('test_suite'); $this->Task->expectOnce('err'); } - /** * Test table name interactions * @@ -180,7 +171,6 @@ class ModelTaskTest extends CakeTestCase { $result = $this->Task->initValidations(); $this->assertTrue(in_array('notempty', $result)); } - /** * test that individual field validation works, with interactive = false * tests the guessing features of validation @@ -209,7 +199,6 @@ class ModelTaskTest extends CakeTestCase { $result = $this->Task->fieldValidation('test', array('type' => 'boolean', 'length' => 10, 'null' => false)); $expected = array('numeric' => 'numeric'); } - /** * test that interactive field validation works and returns multiple validators. * @@ -227,7 +216,6 @@ class ModelTaskTest extends CakeTestCase { $expected = array('notempty' => 'notempty', 'maxlength' => 'maxlength'); $this->assertEqual($result, $expected); } - /** * test the validation Generation routine * @@ -288,7 +276,6 @@ class ModelTaskTest extends CakeTestCase { ); $this->assertEqual($result, $expected); } - /** * test that finding primary key works * @@ -306,7 +293,6 @@ class ModelTaskTest extends CakeTestCase { $expected = 'my_field'; $this->assertEqual($result, $expected); } - /** * test finding Display field * @@ -326,7 +312,6 @@ class ModelTaskTest extends CakeTestCase { $result = $this->Task->findDisplayField($fields); $this->assertEqual($result, 'tagname'); } - /** * test that belongsTo generation works. * @@ -365,7 +350,6 @@ class ModelTaskTest extends CakeTestCase { ); $this->assertEqual($result, $expected); } - /** * test that hasOne and/or hasMany relations are generated properly. * @@ -415,7 +399,6 @@ class ModelTaskTest extends CakeTestCase { ); $this->assertEqual($result, $expected); } - /** * test that habtm generation works * @@ -439,7 +422,6 @@ class ModelTaskTest extends CakeTestCase { ); $this->assertEqual($result, $expected); } - /** * test non interactive doAssociations * @@ -482,7 +464,6 @@ class ModelTaskTest extends CakeTestCase { $this->assertEqual($this->Task->plugin, $this->Task->Fixture->plugin); $this->assertEqual($this->Task->connection, $this->Task->Fixture->connection); } - /** * Ensure that the test object is correctly called. * @@ -495,7 +476,6 @@ class ModelTaskTest extends CakeTestCase { $this->assertEqual($this->Task->plugin, $this->Task->Test->plugin); $this->assertEqual($this->Task->connection, $this->Task->Test->connection); } - /** * test confirming of associations, and that when an association is hasMany * a question for the hasOne is also not asked. @@ -536,7 +516,6 @@ class ModelTaskTest extends CakeTestCase { $this->assertTrue(empty($result['hasMany'])); $this->assertTrue(empty($result['hasOne'])); } - /** * test that inOptions generates questions and only accepts a valid answer * @@ -556,7 +535,6 @@ class ModelTaskTest extends CakeTestCase { $result = $this->Task->inOptions($options, 'Pick a number'); $this->assertEqual($result, 1); } - /** * test baking validation * @@ -584,7 +562,6 @@ class ModelTaskTest extends CakeTestCase { $pattern = '/' . preg_quote("'notempty' => array('rule' => array('notempty')),", '/') . '/'; $this->assertPattern($pattern, $result); } - /** * test baking relations * @@ -638,7 +615,6 @@ class ModelTaskTest extends CakeTestCase { $this->assertPattern('/SomethingElse/', $result); $this->assertPattern('/Comment/', $result); } - /** * test bake() with a -plugin param * @@ -658,7 +634,6 @@ class ModelTaskTest extends CakeTestCase { $path, new PatternExpectation('/Article extends ControllerTestAppModel/'))); $this->Task->bake('Article', array(), array()); } - /** * test that execute passes runs bake depending with named model. * @@ -673,7 +648,6 @@ class ModelTaskTest extends CakeTestCase { $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article extends AppModel/'))); $this->Task->execute(); } - /** * test that execute runs all() when args[0] = all * @@ -705,7 +679,6 @@ class ModelTaskTest extends CakeTestCase { $this->Task->execute(); } - /** * test the interactive side of bake. * @@ -734,7 +707,6 @@ class ModelTaskTest extends CakeTestCase { $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article/'))); $this->Task->execute(); } - /** * test using bake interactively with a table that does not exist. * diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index 1d9e74532..120bf50ef 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -56,9 +56,8 @@ Mock::generate('ModelTask', 'PluginTestMockModelTask'); * @subpackage cake.tests.cases.console.libs.tasks */ class PluginTaskTest extends CakeTestCase { - /** - * setUp method + * startTest method * * @return void * @access public @@ -70,7 +69,6 @@ class PluginTaskTest extends CakeTestCase { $this->Task->Dispatch =& $this->Dispatcher; $this->Task->path = TMP . 'tests' . DS; } - /** * startCase methods * @@ -81,7 +79,6 @@ class PluginTaskTest extends CakeTestCase { $this->_testPath = array_push($paths, TMP . 'tests' . DS); App::build(array('plugins' => $paths)); } - /** * endCase * @@ -90,9 +87,8 @@ class PluginTaskTest extends CakeTestCase { function endCase() { App::build(array('plugins' => $this->_paths)); } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -100,7 +96,6 @@ class PluginTaskTest extends CakeTestCase { function endTest() { ClassRegistry::flush(); } - /** * test bake() * @@ -189,7 +184,6 @@ class PluginTaskTest extends CakeTestCase { $Folder =& new Folder($this->Task->path . 'bake_test_plugin'); $Folder->delete(); } - /** * Test Execute * @@ -213,7 +207,6 @@ class PluginTaskTest extends CakeTestCase { $Folder =& new Folder($this->Task->path . 'bake_test_plugin'); $Folder->delete(); } - /** * test execute chaining into MVC parts * diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index a78f97659..928f54b0b 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -53,9 +53,8 @@ Mock::generatePartial( * @subpackage cake.tests.cases.console.libs.tasks */ class ProjectTaskTest extends CakeTestCase { - /** - * setUp method + * startTest method * * @return void * @access public @@ -67,9 +66,8 @@ class ProjectTaskTest extends CakeTestCase { $this->Task->Dispatch =& $this->Dispatcher; $this->Task->path = TMP . 'tests' . DS; } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -80,7 +78,6 @@ class ProjectTaskTest extends CakeTestCase { $Folder =& new Folder($this->Task->path . 'bake_test_app'); $Folder->delete(); } - /** * creates a test project that is used for testing project task. * @@ -92,7 +89,6 @@ class ProjectTaskTest extends CakeTestCase { $this->Task->setReturnValueAt(1, 'in', 'n'); $this->Task->bake($this->Task->path . 'bake_test_app', $skel); } - /** * test bake() method and directory creation. * @@ -113,7 +109,6 @@ class ProjectTaskTest extends CakeTestCase { $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'groups'), 'No groups dir %s'); $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'fixtures'), 'No fixtures dir %s'); } - /** * test generation of Security.salt * @@ -130,7 +125,6 @@ class ProjectTaskTest extends CakeTestCase { $contents = $file->read(); $this->assertNoPattern('/DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi/', $contents, 'Default Salt left behind. %s'); } - /** * test getAdmin method, and that it returns Routing.admin or writes to config file. * @@ -149,7 +143,6 @@ class ProjectTaskTest extends CakeTestCase { $result = $this->Task->getAdmin(); $this->assertEqual($result, 'super_duper_admin_'); } - /** * Test execute method with one param to destination folder. * diff --git a/cake/tests/cases/console/libs/tasks/template.test.php b/cake/tests/cases/console/libs/tasks/template.test.php index fbb6a439c..6d13ae2d7 100644 --- a/cake/tests/cases/console/libs/tasks/template.test.php +++ b/cake/tests/cases/console/libs/tasks/template.test.php @@ -16,7 +16,7 @@ * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org * @package cake - * @subpackage cake. + * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP(tm) v 1.3 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ @@ -53,7 +53,7 @@ Mock::generatePartial( */ class TemplateTaskTest extends CakeTestCase { /** - * setUp method + * startTest method * * @return void * @access public @@ -61,12 +61,11 @@ class TemplateTaskTest extends CakeTestCase { function startTest() { $this->Dispatcher =& new TestTemplateTaskMockShellDispatcher(); $this->Task =& new MockTemplateTask($this->Dispatcher); - $this->Task->Dispatch = new $this->Dispatcher; + $this->Task->Dispatch =& $this->Dispatcher; $this->Task->Dispatch->shellPaths = App::path('shells'); } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -75,7 +74,6 @@ class TemplateTaskTest extends CakeTestCase { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } - /** * test that set sets variables * @@ -92,7 +90,6 @@ class TemplateTaskTest extends CakeTestCase { $this->assertTrue(isset($this->Task->templateVars['four'])); $this->assertEqual($this->Task->templateVars['four'], 'five'); } - /** * test finding themes installed in * @@ -104,7 +101,6 @@ class TemplateTaskTest extends CakeTestCase { $this->Task->initialize(); $this->assertEqual($this->Task->templatePaths, array('default' => $consoleLibs . 'templates' . DS . 'default' . DS)); } - /** * test getting the correct theme name. Ensure that with only one theme, or a theme param * that the user is not bugged. If there are more, find and return the correct theme name @@ -128,9 +124,8 @@ class TemplateTaskTest extends CakeTestCase { $this->Task->setReturnValueAt(0, 'in', '1'); $result = $this->Task->getThemePath(); $this->assertEqual($result, $defaultTheme); - $this->assertEqual($this->Dispatch->params['theme'], 'default'); + $this->assertEqual($this->Dispatcher->params['theme'], 'default'); } - /** * test generate * @@ -145,7 +140,6 @@ class TemplateTaskTest extends CakeTestCase { $expected = "I got rendered\nfoo"; $this->assertEqual($result, $expected); } - /** * test generate with a missing template in the chosen theme. * ensure fallback to default works. diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 8b695329d..7525ff0bf 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -8,20 +8,17 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2009, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2009, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP v 1.2.0.7726 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ App::import('Core', 'Shell'); @@ -126,7 +123,7 @@ class TestTaskTest extends CakeTestCase { var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); /** - * setUp method + * startTest method * * @return void * @access public @@ -138,9 +135,8 @@ class TestTaskTest extends CakeTestCase { $this->Task->Dispatch =& $this->Dispatcher; $this->Task->Template =& new TemplateTask($this->Dispatcher); } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -148,7 +144,6 @@ class TestTaskTest extends CakeTestCase { function endTest() { ClassRegistry::flush(); } - /** * Test that file path generation doesn't continuously append paths. * @@ -172,7 +167,6 @@ class TestTaskTest extends CakeTestCase { $this->Task->expectAt(2, 'createFile', array($file, '*')); $this->Task->bake('Controller', 'Comments'); } - /** * Test that method introspection pulls all relevant non parent class * methods into the test case. @@ -184,7 +178,6 @@ class TestTaskTest extends CakeTestCase { $expected = array('doSomething', 'doSomethingElse'); $this->assertEqual($result, $expected); } - /** * test that the generation of fixtures works correctly. * @@ -198,7 +191,6 @@ class TestTaskTest extends CakeTestCase { $this->assertEqual(sort($result), sort($expected)); } - /** * test that the generation of fixtures works correctly. * @@ -212,7 +204,6 @@ class TestTaskTest extends CakeTestCase { $this->assertEqual(sort($result), sort($expected)); } - /** * test user interaction to get object type * @@ -227,7 +218,6 @@ class TestTaskTest extends CakeTestCase { $result = $this->Task->getObjectType(); $this->assertEqual($result, $this->Task->classTypes[1]); } - /** * creating test subjects should clear the registry so the registry is always fresh * @@ -251,7 +241,6 @@ class TestTaskTest extends CakeTestCase { $keys = ClassRegistry::keys(); $this->assertFalse(in_array('random', $keys)); } - /** * test that getClassName returns the user choice as a classname. * @@ -272,7 +261,6 @@ class TestTaskTest extends CakeTestCase { $options = Configure::listObjects('model'); $this->assertEqual($result, $options[0]); } - /** * Test the user interaction for defining additional fixtures. * @@ -285,7 +273,6 @@ class TestTaskTest extends CakeTestCase { $expected = array('app.pizza', 'app.topping', 'app.side_dish'); $this->assertEqual($result, $expected); } - /** * test that resolving classnames works * @@ -307,7 +294,6 @@ class TestTaskTest extends CakeTestCase { $result = $this->Task->getRealClassname('Component', 'Auth'); $this->assertEqual($result, 'AuthComponent'); } - /** * test baking files. * @@ -336,7 +322,6 @@ class TestTaskTest extends CakeTestCase { $this->assertPattern("/'app\.test_task_tag'/", $result); $this->assertPattern("/'app\.articles_tag'/", $result); } - /** * test baking controller test files, ensure that the stub class is generated. * @@ -366,7 +351,6 @@ class TestTaskTest extends CakeTestCase { $this->assertPattern("/'app\.test_task_tag'/", $result); $this->assertPattern("/'app\.articles_tag'/", $result); } - /** * test Constructor generation ensure that constructClasses is called for controllers * @@ -385,7 +369,6 @@ class TestTaskTest extends CakeTestCase { $expected = "new FormHelper()\n"; $this->assertEqual($result, $expected); } - /** * Test that mock class generation works for the appropriate classes * @@ -395,7 +378,6 @@ class TestTaskTest extends CakeTestCase { $result = $this->Task->hasMockClass('controller'); $this->assertTrue($result); } - /** * test bake() with a -plugin param * @@ -408,7 +390,6 @@ class TestTaskTest extends CakeTestCase { $this->Task->expectAt(0, 'createFile', array($path, '*')); $this->Task->bake('Helper', 'Form'); } - /** * Test filename generation for each type + plugins * @@ -442,7 +423,6 @@ class TestTaskTest extends CakeTestCase { $expected = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'cases' . DS . 'models' . DS . 'post.test.php'; $this->assertEqual($result, $expected); } - /** * test execute with a type defined * @@ -455,7 +435,6 @@ class TestTaskTest extends CakeTestCase { $this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/'))); $this->Task->execute(); } - /** * test execute with type and class name defined * diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index 1f8f78dbd..ca2251f89 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -1,5 +1,4 @@