From bb99f9bc13f91c102242fa41eeb58c177b8ef8dd Mon Sep 17 00:00:00 2001 From: AD7six Date: Fri, 22 Apr 2011 21:53:02 +0200 Subject: [PATCH 1/3] removing clear from welcome while it's superficially useful to start from a clean screen - it's not actually helpful. Quite often cake will issue setup errors which a user will not see because they are immediately cleared. Users continue using the cli unaware that they have (possibly significant) problems --- lib/Cake/Console/Shell.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/Cake/Console/Shell.php b/lib/Cake/Console/Shell.php index ad5b716fa..be43d58e4 100644 --- a/lib/Cake/Console/Shell.php +++ b/lib/Cake/Console/Shell.php @@ -165,7 +165,7 @@ class Shell extends Object { if ($this->stdin == null) { $this->stdin = new ConsoleInput('php://stdin'); } - + $parent = get_parent_class($this); if ($this->tasks !== null && $this->tasks !== false) { $this->_mergeVars(array('tasks'), $parent, true); @@ -200,7 +200,6 @@ class Shell extends Object { * */ protected function _welcome() { - $this->clear(); $this->out(); $this->out('Welcome to CakePHP v' . Configure::version() . ' Console'); $this->hr(); @@ -296,16 +295,16 @@ class Shell extends Object { * but intended for running shells from other shells. * * ### Usage: - * + * * With a string commmand: * * `return $this->dispatchShell('schema create DbAcl');` * * With an array command: * - * `return $this->dispatchShell('schema', 'create', 'i18n', '--dry');` + * `return $this->dispatchShell('schema', 'create', 'i18n', '--dry');` * - * @param mixed $command Either an array of args similar to $argv. Or a string command, that can be + * @param mixed $command Either an array of args similar to $argv. Or a string command, that can be * exploded on space to simulate argv. * @return mixed. The return of the other shell. */ @@ -471,7 +470,7 @@ class Shell extends Object { /** * Wrap a block of text. - * Allows you to set the width, and indenting on a block of text. + * Allows you to set the width, and indenting on a block of text. * * ### Options * @@ -480,7 +479,7 @@ class Shell extends Object { * - `indent` Indent the text with the string provided. Defaults to null. * * @param string $text Text the text to format. - * @param mixed $options Array of options to use, or an integer to wrap the text to. + * @param mixed $options Array of options to use, or an integer to wrap the text to. * @return string Wrapped / indented text * @see String::wrap() */ From 9ce80c4f4a4e4f44d14010f9dad401af3e048799 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 22 Apr 2011 16:03:10 -0400 Subject: [PATCH 2/3] Adding files I forgot to commit :( --- lib/Cake/tests/Case/AllCoreTest.php | 41 +++++++++++++++++ .../tests/Case/Console/AllConsoleTest.php | 44 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 lib/Cake/tests/Case/AllCoreTest.php create mode 100644 lib/Cake/tests/Case/Console/AllConsoleTest.php diff --git a/lib/Cake/tests/Case/AllCoreTest.php b/lib/Cake/tests/Case/AllCoreTest.php new file mode 100644 index 000000000..e12152d00 --- /dev/null +++ b/lib/Cake/tests/Case/AllCoreTest.php @@ -0,0 +1,41 @@ +addTestDirectory(CORE_TEST_CASES . DS . 'Core'); + return $suite; + } +} + diff --git a/lib/Cake/tests/Case/Console/AllConsoleTest.php b/lib/Cake/tests/Case/Console/AllConsoleTest.php new file mode 100644 index 000000000..e96c67edb --- /dev/null +++ b/lib/Cake/tests/Case/Console/AllConsoleTest.php @@ -0,0 +1,44 @@ +addTestFile($path . 'AllConsoleLibsTest.php'); + $suite->addTestFile($path . 'AllTasksTest.php'); + $suite->addTestFile($path . 'AllShellsTest.php'); + return $suite; + } +} From 658a1872cea74e7617e5355181b8bdf9d078b6c9 Mon Sep 17 00:00:00 2001 From: AD7six Date: Fri, 22 Apr 2011 22:29:02 +0200 Subject: [PATCH 3/3] show testcases sorted alphabetically --- lib/Cake/TestSuite/CakeTestLoader.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Cake/TestSuite/CakeTestLoader.php b/lib/Cake/TestSuite/CakeTestLoader.php index e00b716f4..9fb47278a 100644 --- a/lib/Cake/TestSuite/CakeTestLoader.php +++ b/lib/Cake/TestSuite/CakeTestLoader.php @@ -22,8 +22,8 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader { /** * Load a file and find the first test case / suite in that file. * - * @param string $filePath - * @param string $params + * @param string $filePath + * @param string $params * @return ReflectionClass */ public function load($filePath, $params = '') { @@ -45,7 +45,7 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader { /** * Generates the base path to a set of tests based on the parameters. * - * @param array $params + * @param array $params * @return string The base path. */ protected static function _basePath($params) { @@ -76,6 +76,7 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader { $case = str_replace('Test.php', '', $case); $testCases[$testCaseFile] = $case; } + sort($testCases); return $testCases; }