diff --git a/app/webroot/css/cake.generic.css b/app/webroot/css/cake.generic.css index 77ca75e80..3de408a0c 100644 --- a/app/webroot/css/cake.generic.css +++ b/app/webroot/css/cake.generic.css @@ -1,6 +1,6 @@ /** * - * PHP versions 4 and 5 + * Generic CSS for CakePHP * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) @@ -21,7 +21,7 @@ padding:0; } -/* General Style Info */ +/** General Style Info **/ body { background: #003d4c; color: #fff; @@ -30,14 +30,12 @@ body { margin: 0; } a { - background:#fff; color: #003d4c; text-decoration: underline; font-weight: bold; } a:hover { - background:#fff; - color: #003d4c; + color: #367889; text-decoration:none; } a img { @@ -45,37 +43,33 @@ a img { } h1, h2, h3, h4 { font-weight: normal; + margin-bottom:0.5em; } h1 { background:#fff; color: #003d4c; font-size: 100%; - margin: 0.1em 0; } h2 { background:#fff; color: #e32; - font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif; + font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif; font-size: 190%; - margin: 0.3em 0; - padding-top: 0.8em; } h3 { color: #993; - font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif; + font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif; font-size: 165%; - padding-top: 1.5em; } h4 { color: #993; font-weight: normal; - padding-top: 0.5em; } ul, li { margin: 0 12px; } -/* Layout */ +/** Layout **/ #container { text-align: left; } @@ -84,7 +78,8 @@ ul, li { padding: 10px 20px; } #header h1 { - background: #003d4c url('../img/cake.icon.gif') no-repeat left; + line-height:20px; + background: #003d4c url('../img/cake.icon.png') no-repeat left; color: #fff; padding: 0px 30px; } @@ -112,10 +107,29 @@ ul, li { text-align: right; } -/* Tables */ +/** containers **/ +div.form, +div.index, +div.view { + float:right; + width:76%; + border-left:1px solid #666; + padding:10px 2%; +} +div.actions { + float:left; + width:16%; + padding:10px 1.5%; +} +div.actions h3 { + padding-top:0; + color:#777; +} + + +/** Tables **/ table { background: #fff; - border:1px solid #ccc; border-right:0; clear: both; color: #333; @@ -123,39 +137,42 @@ table { width: 100%; } th { - background: #f2f2f2; - border:1px solid #bbb; - border-top: 1px solid #fff; - border-left: 1px solid #fff; - text-align: center; + border:0; + border-bottom:2px solid #555; + text-align: left; + padding:4px; } th a { - background:#f2f2f2; display: block; padding: 2px 4px; text-decoration: none; } -th a:hover { - background: #ccc; - color: #333; - text-decoration: none; +th a.asc:after { + content: ' ⇣'; +} +th a.desc:after { + content: ' ⇡'; } table tr td { background: #fff; - border-right: 1px solid #ccc; - padding: 4px; - text-align: center; + padding: 6px; + text-align: left; vertical-align: top; + border-bottom:1px solid #ddd; } -table tr.altrow td { - background: #f4f4f4; +table tr:nth-child(2n) td { + background: #f5f5f5; +} +table .altrow td { + background: #f5f5f5; } td.actions { text-align: center; white-space: nowrap; } -td.actions a { +table td.actions a { margin: 0px 6px; + padding:2px 5px; } .cake-sql-log table { background: #f4f4f4; @@ -163,27 +180,30 @@ td.actions a { .cake-sql-log td { padding: 4px 8px; text-align: left; + font-family: Monaco, Consolas, "Courier New", monospaced; +} +.cake-sql-log caption { + color:#fff; } -/* Paging */ +/** Paging **/ div.paging { background:#fff; color: #ccc; - margin-bottom: 2em; + margin-top: 1em; + clear:both; } -div.paging div.disabled { +div.paging span.disabled { color: #ddd; display: inline; } -div.paging span { -} div.paging span.current { - color: #000; + color: #c73e14; } div.paging span a { } -/* Scaffold View */ +/** Scaffold View **/ dl { line-height: 2em; margin: 0em 0em; @@ -203,16 +223,16 @@ dd { vertical-align: top; } -/* Forms */ +/** Forms **/ form { clear: both; margin-right: 20px; padding: 0; - width: 80%; + width: 95%; } fieldset { border: 1px solid #ccc; - margin-top: 30px; + margin-bottom: 1em; padding: 16px 20px; } fieldset legend { @@ -240,30 +260,33 @@ form div { padding: .5em; vertical-align: text-top; } -form div.input { +form .input { color: #444; } -form div.required { - color: #333; +form .required { font-weight: bold; } +form .required label:after { + color: #e32; + content: '*'; + display:inline; +} form div.submit { border: 0; clear: both; margin-top: 10px; - margin-left: 140px; } label { display: block; font-size: 110%; - padding-right: 20px; + margin-bottom:3px; } input, textarea { clear: both; font-size: 140%; font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif; - padding: 2px; - width: 100%; + padding: 1%; + width:98%; } select { clear: both; @@ -283,6 +306,9 @@ input[type=checkbox] { margin: 0px 6px 7px 2px; width: auto; } +div.checkbox label { + display: inline; +} input[type=radio] { float:left; width:auto; @@ -294,23 +320,37 @@ div.radio label { input[type=submit] { display: inline; font-size: 110%; - padding: 2px 5px; width: auto; - vertical-align: bottom; +} +form .submit input[type=submit] { + background:#62af56; + background: -webkit-gradient(linear, left top, left bottom, from(#a8ea9c), to(#62af56)); + background-image: -moz-linear-gradient(top, #a8ea9c, #62af56); + border-color: #2d6324; + color: #000; + text-shadow: #8cee7c 0px 1px 0px; +} +form .submit input[type=submit]:hover { + background:#4ca83d; + background: -webkit-gradient(linear, left top, left bottom, from(#85e573), to(#4ca83d)); + background-image: -moz-linear-gradient(top, #85e573, #4ca83d); } -/* Notices and Errors */ +/** Notices and Errors **/ div.message { clear: both; - color: #900; + color: #fff; font-size: 140%; font-weight: bold; - margin: 1em 0; + margin: 0 0 1em 0; + background: #c73e14; + padding: 5px; } div.error-message { clear: both; - color: #900; + color: #fff; font-weight: bold; + background: #c73e14; } p.error { background-color: #e32; @@ -341,35 +381,57 @@ p.error em { color: #fff; } -/* Actions */ +/** Actions **/ div.actions ul { - margin: 0px 0; + margin: 0; padding: 0; } div.actions li { - display: inline; + margin:0 0 0.5em 0; list-style-type: none; - line-height: 2em; - margin: 0 2em 0 0; white-space: nowrap; + padding: 0; } div.actions ul li a { - background:#fff; - color: #003d4c; - text-decoration: none; + font-weight: normal; + display: block; + clear: both; } div.actions ul li a:hover { - color: #333; text-decoration: underline; } -/* Related */ +input[type=submit], +div.actions ul li a, +td.actions a { + font-weight:normal; + padding: 4px 8px; + background:#e6e49f; + background: -webkit-gradient(linear, left top, left bottom, from(#f1f1d4), to(#e6e49f)); + background-image: -moz-linear-gradient(top, #f1f1d4, #e6e49f); + color:#333; + border:1px solid #aaac62; + -webkit-border-radius:8px; + -moz-border-radius:8px; + border-radius:8px; + text-decoration:none; + text-shadow: #fff 0px 1px 0px; + min-width: 0; +} +input[type=submit]:hover, +div.actions ul li a:hover, +td.actions a:hover { + background: #f0f09a; + background: -webkit-gradient(linear, left top, left bottom, from(#f7f7e1), to(#eeeca9)); +} + +/** Related **/ div.related { clear: both; display: block; } -/* Debugging */ +/** Debugging **/ pre { color: #000; background: #f0f0f0; @@ -385,7 +447,6 @@ pre.cake-debug { } div.cake-stack-trace { background: #fff; - border: 4px dotted #ffcc00; color: #333; margin: 0px; padding: 6px; diff --git a/app/webroot/img/cake.icon.gif b/app/webroot/img/cake.icon.gif deleted file mode 100644 index f29f72ebe..000000000 Binary files a/app/webroot/img/cake.icon.gif and /dev/null differ diff --git a/app/webroot/img/cake.icon.png b/app/webroot/img/cake.icon.png new file mode 100644 index 000000000..394fa42d5 Binary files /dev/null and b/app/webroot/img/cake.icon.png differ diff --git a/app/webroot/test.php b/app/webroot/test.php index b87686602..2e0aacb49 100644 --- a/app/webroot/test.php +++ b/app/webroot/test.php @@ -18,7 +18,6 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ set_time_limit(0); -ini_set('memory_limit','128M'); ini_set('display_errors', 1); /** * Use the DS to separate the directories in other defines @@ -85,89 +84,13 @@ if (isset($corePath[0])) { define('TEST_CAKE_CORE_INCLUDE_PATH', CAKE_CORE_INCLUDE_PATH); } -require_once CAKE_TESTS_LIB . 'test_manager.php'; - if (Configure::read('debug') < 1) { die(__('Debug setting does not allow access to this url.', true)); } -if (!isset($_SERVER['SERVER_NAME'])) { - $_SERVER['SERVER_NAME'] = ''; -} -if (empty( $_GET['output'])) { - $_GET['output'] = 'html'; -} -/** - * - * Used to determine output to display - */ -define('CAKE_TEST_OUTPUT_HTML', 1); -define('CAKE_TEST_OUTPUT_TEXT', 2); +require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php'; -if (isset($_GET['output']) && $_GET['output'] == 'html') { - define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_HTML); -} else { - Debugger::output('txt'); - define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_TEXT); -} +$Dispatcher = new CakeTestSuiteDispatcher(); +$Dispatcher->dispatch(); -if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) { - CakePHPTestHeader(); - include CAKE_TESTS_LIB . 'simpletest.php'; - CakePHPTestSuiteFooter(); - exit(); -} - -$analyzeCodeCoverage = false; -if (isset($_GET['code_coverage'])) { - $analyzeCodeCoverage = true; - require_once CAKE_TESTS_LIB . 'code_coverage_manager.php'; - if (!extension_loaded('xdebug')) { - CakePHPTestHeader(); - include CAKE_TESTS_LIB . 'xdebug.php'; - CakePHPTestSuiteFooter(); - exit(); - } -} - -CakePHPTestHeader(); -CakePHPTestSuiteHeader(); -define('RUN_TEST_LINK', $_SERVER['PHP_SELF']); - -if (isset($_GET['group'])) { - if ('all' == $_GET['group']) { - TestManager::runAllTests(CakeTestsGetReporter()); - } else { - if ($analyzeCodeCoverage) { - CodeCoverageManager::start($_GET['group'], CakeTestsGetReporter()); - } - TestManager::runGroupTest(ucfirst($_GET['group']), CakeTestsGetReporter()); - if ($analyzeCodeCoverage) { - CodeCoverageManager::report(); - } - } - - CakePHPTestRunMore(); - CakePHPTestAnalyzeCodeCoverage(); -} elseif (isset($_GET['case'])) { - if ($analyzeCodeCoverage) { - CodeCoverageManager::start($_GET['case'], CakeTestsGetReporter()); - } - - TestManager::runTestCase($_GET['case'], CakeTestsGetReporter()); - - if ($analyzeCodeCoverage) { - CodeCoverageManager::report(); - } - - CakePHPTestRunMore(); - CakePHPTestAnalyzeCodeCoverage(); -} elseif (isset($_GET['show']) && $_GET['show'] == 'cases') { - CakePHPTestCaseList(); -} else { - CakePHPTestGroupTestList(); -} -CakePHPTestSuiteFooter(); -$output = ob_get_clean(); -echo $output; ?> \ No newline at end of file diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 82dec5869..195392d1c 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -54,6 +54,7 @@ class FixtureTask extends Shell { * The db connection being used for baking * * @var string + * @access public */ var $connection = null; @@ -61,6 +62,7 @@ class FixtureTask extends Shell { * Schema instance * * @var object + * @access protected */ var $_Schema = null; @@ -140,6 +142,7 @@ class FixtureTask extends Shell { * * @param string $modelName Name of model you are dealing with. * @return array Array of import options. + * @access public */ function importOptions($modelName) { $options = array(); @@ -167,8 +170,8 @@ class FixtureTask extends Shell { * @param string $model Name of model to bake. * @param string $useTable Name of table to use. * @param array $importOptions Options for var $import - * @return string Baked fixture - * @access private + * @return string Baked fixture content + * @access public */ function bake($model, $useTable = false, $importOptions = array()) { if (!class_exists('CakeSchema')) { @@ -228,8 +231,8 @@ class FixtureTask extends Shell { * * @param string $model name of the model being generated * @param string $fixture Contents of the fixture file. + * @return string Content saved into fixture file. * @access public - * @return void */ function generateFixtureFile($model, $otherVars) { $defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null); @@ -255,6 +258,7 @@ class FixtureTask extends Shell { * * @param array $table Table schema array * @return string fields definitions + * @access protected */ function _generateSchema($tableInfo) { $schema = $this->_Schema->generateTable('f', $tableInfo); @@ -266,6 +270,7 @@ class FixtureTask extends Shell { * * @param array $table Table schema array * @return array Array of records to use in the fixture. + * @access protected */ function _generateRecords($tableInfo, $recordCount = 1) { $records = array(); @@ -337,6 +342,7 @@ class FixtureTask extends Shell { * * @param array $records Array of records to be converted to string * @return string A string value of the $records array. + * @access protected */ function _makeRecordString($records) { $out = "array(\n"; @@ -360,6 +366,7 @@ class FixtureTask extends Shell { * @param string $modelName name of the model to take records from. * @param string $useTable Name of table to use. * @return array Array of records. + * @access protected */ function _getRecordsFromTable($modelName, $useTable = null) { if ($this->interactive) { @@ -378,7 +385,7 @@ class FixtureTask extends Shell { 'recursive' => -1 )); $db =& ConnectionManager::getDataSource($modelObject->useDbConfig); - $schema = $modelObject->schema(); + $schema = $modelObject->schema(true); $out = array(); foreach ($records as $record) { $row = array(); diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 9be466056..08ddb3b97 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -186,7 +186,7 @@ class ModelTask extends Shell { if (in_array($useTable, $this->__tables)) { $tempModel = new Model(array('name' => $currentModelName, 'table' => $useTable, 'ds' => $this->connection)); - $fields = $tempModel->schema(); + $fields = $tempModel->schema(true); if (!array_key_exists('id', $fields)) { $primaryKey = $this->findPrimaryKey($fields); } @@ -447,7 +447,7 @@ class ModelTask extends Shell { $this->out(__('One moment while the associations are detected.', true)); } - $fields = $model->schema(); + $fields = $model->schema(true); if (empty($fields)) { return false; } @@ -487,7 +487,7 @@ class ModelTask extends Shell { * @return array $associations with belongsTo added in. */ function findBelongsTo(&$model, $associations) { - $fields = $model->schema(); + $fields = $model->schema(true); foreach ($fields as $fieldName => $field) { $offset = strpos($fieldName, '_id'); if ($fieldName != $model->primaryKey && $fieldName != 'parent_id' && $offset !== false) { @@ -562,7 +562,7 @@ class ModelTask extends Shell { $foreignKey = $this->_modelKey($model->name); foreach ($this->__tables as $otherTable) { $tempOtherModel = $this->_getModelObject($this->_modelName($otherTable), $otherTable); - $modelFieldsTemp = $tempOtherModel->schema(); + $modelFieldsTemp = $tempOtherModel->schema(true); $offset = strpos($otherTable, $model->table . '_'); $otherOffset = strpos($otherTable, '_' . $model->table); @@ -695,7 +695,7 @@ class ModelTask extends Shell { $possible = array(); foreach ($this->__tables as $otherTable) { $tempOtherModel = & new Model(array('table' => $otherTable, 'ds' => $this->connection)); - $modelFieldsTemp = $tempOtherModel->schema(); + $modelFieldsTemp = $tempOtherModel->schema(true); foreach ($modelFieldsTemp as $fieldName => $field) { if ($field['type'] == 'integer' || $field['type'] == 'string') { $possible[$otherTable][] = $fieldName; @@ -821,6 +821,7 @@ class ModelTask extends Shell { $tables = array(); $db =& ConnectionManager::getDataSource($useDbConfig); + $db->cacheSources = false; $usePrefix = empty($db->config['prefix']) ? '' : $db->config['prefix']; if ($usePrefix) { foreach ($db->listSources() as $table) { diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 06cf9c5bb..5c1cb7e1c 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -46,6 +46,7 @@ class TestTask extends Shell { * Tasks used. * * @var array + * @access public */ var $tasks = array('Template'); @@ -53,6 +54,7 @@ class TestTask extends Shell { * class types that methods can be generated for * * @var array + * @access public */ var $classTypes = array('Model', 'Controller', 'Component', 'Behavior', 'Helper'); @@ -60,6 +62,7 @@ class TestTask extends Shell { * Internal list of fixtures that have been added so far. * * @var string + * @access protected */ var $_fixtures = array(); @@ -164,6 +167,7 @@ class TestTask extends Shell { * Interact with the user and get their chosen type. Can exit the script. * * @return string Users chosen type. + * @access public */ function getObjectType() { $this->hr(); @@ -188,6 +192,7 @@ class TestTask extends Shell { * * @param string $objectType Type of object to list classes for i.e. Model, Controller. * @return string Class name the user chose. + * @access public */ function getClassName($objectType) { $options = App::objects(strtolower($objectType)); @@ -207,8 +212,11 @@ class TestTask extends Shell { /** * Checks whether the chosen type can find its own fixtures. * Currently only model, and controller are supported - * + * + * @param string $type The Type of object you are generating tests for eg. controller + * @param string $className the Classname of the class the test is being generated for. * @return boolean + * @access public */ function typeCanDetectFixtures($type) { $type = strtolower($type); @@ -218,7 +226,10 @@ class TestTask extends Shell { /** * Check if a class with the given type is loaded or can be loaded. * + * @param string $type The Type of object you are generating tests for eg. controller + * @param string $className the Classname of the class the test is being generated for. * @return boolean + * @access public */ function isLoadableClass($type, $class) { return App::import($type, $class); @@ -228,7 +239,10 @@ class TestTask extends Shell { * Construct an instance of the class to be tested. * So that fixtures can be detected * - * @return object + * @param string $type The Type of object you are generating tests for eg. controller + * @param string $class the Classname of the class the test is being generated for. + * @return object And instance of the class that is going to be tested. + * @access public */ function &buildTestSubject($type, $class) { ClassRegistry::flush(); @@ -245,7 +259,10 @@ class TestTask extends Shell { /** * Gets the real class name from the cake short form. * + * @param string $type The Type of object you are generating tests for eg. controller + * @param string $class the Classname of the class the test is being generated for. * @return string Real classname + * @access public */ function getRealClassName($type, $class) { if (strtolower($type) == 'model') { @@ -260,6 +277,7 @@ class TestTask extends Shell { * * @param string $className Name of class to look at. * @return array Array of method names. + * @access public */ function getTestableMethods($className) { $classMethods = get_class_methods($className); @@ -278,8 +296,9 @@ class TestTask extends Shell { * Generate the list of fixtures that will be required to run this test based on * loaded models. * - * @param object The object you want to generate fixtures for. + * @param object $subject The object you want to generate fixtures for. * @return array Array of fixtures to be included in the test. + * @access public */ function generateFixtureList(&$subject) { $this->_fixtures = array(); @@ -295,6 +314,7 @@ class TestTask extends Shell { * Process a model recursively and pull out all the * model names converting them to fixture names. * + * @param Model $subject A Model class to scan for associations and pull fixtures off of. * @return void * @access protected */ @@ -319,6 +339,7 @@ class TestTask extends Shell { * Process all the models attached to a controller * and generate a fixture list. * + * @param Controller $subject A controller to pull model names off of. * @return void * @access protected */ @@ -337,6 +358,7 @@ class TestTask extends Shell { * Add classname to the fixture list. * Sets the app. or plugin.plugin_name. prefix. * + * @param string $name Name of the Model class that a fixture might be required for. * @return void * @access protected */ @@ -354,7 +376,8 @@ class TestTask extends Shell { /** * Interact with the user to get additional fixtures they want to use. * - * @return void + * @return array Array of fixtures the user wants to add. + * @access public */ function getUserFixtures() { $proceed = $this->in(__('Bake could not detect fixtures, would you like to add some?', true), array('y','n'), 'n'); @@ -372,7 +395,9 @@ class TestTask extends Shell { * Is a mock class required for this type of test? * Controllers require a mock class. * + * @param string $type The type of object tests are being generated for eg. controller. * @return boolean + * @access public */ function hasMockClass($type) { $type = strtolower($type); @@ -382,7 +407,10 @@ class TestTask extends Shell { /** * Generate a constructor code snippet for the type and classname * + * @param string $type The Type of object you are generating tests for eg. controller + * @param string $className the Classname of the class the test is being generated for. * @return string Constructor snippet for the thing you are building. + * @access public */ function generateConstructor($type, $fullClassName) { $type = strtolower($type); @@ -397,10 +425,13 @@ class TestTask extends Shell { } /** - * make the filename for the test case. resolve the suffixes for controllers + * Make the filename for the test case. resolve the suffixes for controllers * and get the plugin path if needed. * - * @return string filename the test should be created on + * @param string $type The Type of object you are generating tests for eg. controller + * @param string $className the Classname of the class the test is being generated for. + * @return string filename the test should be created on. + * @access public */ function testCaseFileName($type, $className) { $path = $this->path; @@ -418,6 +449,7 @@ class TestTask extends Shell { * Show help file. * * @return void + * @access public */ function help() { $this->hr(); diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 62cb1c82c..fc0a69e42 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -283,7 +283,7 @@ class ViewTask extends Shell { $displayField = $modelObj->displayField; $singularVar = Inflector::variable($modelClass); $singularHumanName = $this->_singularHumanName($modelClass); - $schema = $modelObj->schema(); + $schema = $modelObj->schema(true); $fields = array_keys($schema); $associations = $this->__associations($modelObj); } else { @@ -469,7 +469,7 @@ class ViewTask extends Shell { $associations[$type][$assocKey]['displayField'] = $model->{$assocKey}->displayField; $associations[$type][$assocKey]['foreignKey'] = $assocData['foreignKey']; $associations[$type][$assocKey]['controller'] = Inflector::pluralize(Inflector::underscore($assocData['className'])); - $associations[$type][$assocKey]['fields'] = array_keys($model->{$assocKey}->schema()); + $associations[$type][$assocKey]['fields'] = array_keys($model->{$assocKey}->schema(true)); } } return $associations; diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index d2856e84d..e9a3c30ba 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -69,14 +69,6 @@ class TestSuiteShell extends Shell { */ var $doCoverage = false; -/** - * The headline for the test output - * - * @var string - * @access public - */ - var $headline = 'CakePHP Test Shell'; - /** * Initialization method installs Simpletest and loads all plugins * @@ -94,12 +86,60 @@ class TestSuiteShell extends Shell { $this->__installSimpleTest(); require_once CAKE . 'tests' . DS . 'lib' . DS . 'test_manager.php'; - require_once CAKE . 'tests' . DS . 'lib' . DS . 'cli_reporter.php'; + require_once CAKE . 'tests' . DS . 'lib' . DS . 'reporter' . DS . 'cake_cli_reporter.php'; $plugins = App::objects('plugin'); foreach ($plugins as $p) { $this->plugins[] = Inflector::underscore($p); } + $this->parseArgs(); + $this->getManager(); + } + +/** + * Parse the arguments given into the Shell object properties. + * + * @return void + * @access public + */ + function parseArgs() { + if (empty($this->args)) { + return; + } + $this->category = $this->args[0]; + + if (!in_array($this->category, array('app', 'core'))) { + $this->isPluginTest = true; + } + + if (isset($this->args[1])) { + $this->type = $this->args[1]; + } + + if (isset($this->args[2])) { + if ($this->args[2] == 'cov') { + $this->doCoverage = true; + } else { + $this->file = Inflector::underscore($this->args[2]); + } + } + + if (isset($this->args[3]) && $this->args[3] == 'cov') { + $this->doCoverage = true; + } + } + +/** + * Gets a manager instance, and set the app/plugin properties. + * + * @return void + */ + function getManager() { + $this->Manager = new TestManager(); + $this->Manager->appTest = ($this->category === 'app'); + if ($this->isPluginTest) { + $this->Manager->pluginTest = $this->category; + } } /** @@ -109,46 +149,24 @@ class TestSuiteShell extends Shell { * @access public */ function main() { - $this->out($this->headline); + $this->out(__('CakePHP Test Shell', true)); $this->hr(); - if (count($this->args) > 0) { - $this->category = $this->args[0]; - - if (!in_array($this->category, array('app', 'core'))) { - $this->isPluginTest = true; - } - - if (isset($this->args[1])) { - $this->type = $this->args[1]; - } - - if (isset($this->args[2])) { - if ($this->args[2] == 'cov') { - $this->doCoverage = true; - } else { - $this->file = Inflector::underscore($this->args[2]); - } - } - - if (isset($this->args[3]) && $this->args[3] == 'cov') { - $this->doCoverage = true; - } - } else { - $this->err('Sorry, you did not pass any arguments!'); + if (count($this->args) == 0) { + $this->error(__('Sorry, you did not pass any arguments!', true)); } if ($this->__canRun()) { - $this->out('Running '.$this->category.' '.$this->type.' '.$this->file); + $message = sprintf(__('Running %s %s %s', true), $this->category, $this->type, $this->file); + $this->out($message); $exitCode = 0; if (!$this->__run()) { $exitCode = 1; } - exit($exitCode); + $this->_stop($exitCode); } else { - $this->err('Sorry, the tests could not be found.'); - exit(1); + $this->error(__('Sorry, the tests could not be found.', true)); } } @@ -201,50 +219,37 @@ class TestSuiteShell extends Shell { $isPlugin = in_array(Inflector::underscore($this->category), $this->plugins); if ($isNeitherAppNorCore && !$isPlugin) { - $this->err($this->category.' is an invalid test category (either "app", "core" or name of a plugin)'); + $message = sprintf( + __('%s is an invalid test category (either "app", "core" or name of a plugin)', true), + $this->category + ); + $this->error($message); return false; } $folder = $this->__findFolderByCategory($this->category); if (!file_exists($folder)) { - $this->err($folder . ' not found'); + $this->err(sprintf(__('%s not found', true), $folder)); return false; } if (!in_array($this->type, array('all', 'group', 'case'))) { - $this->err($this->type.' is invalid. Should be case, group or all'); + $this->err(sprintf(__('%s is invalid. Should be case, group or all', true), $this->type)); return false; } - switch ($this->type) { - case 'all': - return true; - break; - case 'group': - if (file_exists($folder.DS.'groups'.DS.$this->file.'.group.php')) { - return true; - } - break; - case 'case': - if ($this->category == 'app' && file_exists($folder.DS.'cases'.DS.$this->file.'.test.php')) { - return true; - } - $coreCaseExists = file_exists($folder.DS.'cases'.DS.$this->file.'.test.php'); - $coreLibCaseExists = file_exists($folder.DS.'cases'.DS.'libs'.DS.$this->file.'.test.php'); - if ($this->category == 'core' && ($coreCaseExists || $coreLibCaseExists)) { - return true; - } - - if ($isPlugin && file_exists($folder.DS.'cases'.DS.$this->file.'.test.php')) { - return true; - } - break; + $fileName = $this->__getFileName($folder, $this->isPluginTest); + if ($fileName === true || file_exists($folder . $fileName)) { + return true; } - $this->err($this->category.' '.$this->type.' '.$this->file.' is an invalid test identifier'); + $message = sprintf( + __('%s %s %s is an invalid test identifier', true), + $this->category, $this->type, $this->file + ); + $this->err($message); return false; } - /** * Executes the tests depending on our settings * @@ -252,69 +257,82 @@ class TestSuiteShell extends Shell { * @access private */ function __run() { - $reporter = new CLIReporter(); - $this->__setGetVars(); + $Reporter = new CakeCliReporter('utf-8', array( + 'app' => $this->Manager->appTest, + 'plugin' => $this->Manager->pluginTest, + 'group' => ($this->type === 'group'), + 'codeCoverage' => $this->doCoverage + )); if ($this->type == 'all') { - return TestManager::runAllTests($reporter); + return $this->Manager->runAllTests($Reporter); } if ($this->doCoverage) { if (!extension_loaded('xdebug')) { - $this->out('You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation. Download it from http://www.xdebug.org/docs/install'); - exit(0); + $this->out(__('You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation. Download it from http://www.xdebug.org/docs/install', true)); + $this->_stop(0); } } if ($this->type == 'group') { $ucFirstGroup = ucfirst($this->file); - - $path = CORE_TEST_GROUPS; - if ($this->category == 'app') { - $path = APP_TEST_GROUPS; - } elseif ($this->isPluginTest) { - $path = APP.'plugins'.DS.$this->category.DS.'tests'.DS.'groups'; - } - if ($this->doCoverage) { require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php'; - CodeCoverageManager::start($ucFirstGroup, $reporter); - } - $result = TestManager::runGroupTest($ucFirstGroup, $reporter); - if ($this->doCoverage) { - CodeCoverageManager::report(); + CodeCoverageManager::init($ucFirstGroup, $Reporter); + CodeCoverageManager::start(); } + $result = $this->Manager->runGroupTest($ucFirstGroup, $Reporter); return $result; } - if ($this->category === 'core') { - $coreCaseExists = file_exists(CORE_TEST_CASES.DS.$this->file.'.test.php'); - if ($coreCaseExists) { - $case = $this->file . '.test.php'; - } else { - $case = 'libs' . DS . $this->file . '.test.php'; - } - } elseif ($this->category === 'app') { - $case = $this->file.'.test.php'; - } elseif ($this->isPluginTest) { - $case = $this->file.'.test.php'; - } + + $folder = $folder = $this->__findFolderByCategory($this->category); + $case = $this->__getFileName($folder, $this->isPluginTest); if ($this->doCoverage) { require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php'; - CodeCoverageManager::start($case, $reporter); + CodeCoverageManager::init($case, $Reporter); + CodeCoverageManager::start(); } - - $result = TestManager::runTestCase($case, $reporter); - if ($this->doCoverage) { - CodeCoverageManager::report(); - } - + $result = $this->Manager->runTestCase($case, $Reporter); return $result; } /** - * Finds the correct folder to look for tests for based on the input category + * Gets the concrete filename for the inputted test name and category/type * + * @param string $folder Folder name to look for files in. + * @param boolean $isPlugin If the test case is a plugin. + * @return mixed Either string filename or boolean false on failure. Or true if the type is 'all' + * @access private + */ + function __getFileName($folder, $isPlugin) { + $ext = $this->Manager->getExtension($this->type); + switch ($this->type) { + case 'all': + return true; + case 'group': + return $this->file . $ext; + case 'case': + if ($this->category == 'app' || $isPlugin) { + return $this->file . $ext; + } + $coreCase = $this->file . $ext; + $coreLibCase = 'libs' . DS . $this->file . $ext; + + if ($this->category == 'core' && file_exists($folder . DS . $coreCase)) { + return $coreCase; + } elseif ($this->category == 'core' && file_exists($folder . DS . $coreLibCase)) { + return $coreLibCase; + } + } + return false; + } + +/** + * Finds the correct folder to look for tests for based on the input category and type. + * + * @param string $category The category of the test. Either 'app', 'core' or a plugin name. * @return string the folder path * @access private */ @@ -322,44 +340,21 @@ class TestSuiteShell extends Shell { $folder = ''; $paths = array( 'core' => CAKE, - 'app' => APP + 'app' => APP ); + $typeDir = $this->type === 'group' ? 'groups' : 'cases'; if (array_key_exists($category, $paths)) { - $folder = $paths[$category] . 'tests'; + $folder = $paths[$category] . 'tests' . DS . $typeDir . DS; } else { - $scoredCategory = Inflector::underscore($category); - $folder = APP . 'plugins' . DS . $scoredCategory . DS; - $pluginPaths = App::path('plugins'); - foreach ($pluginPaths as $path) { - if (file_exists($path . $scoredCategory . DS . 'tests')) { - $folder = $path . $scoredCategory . DS . 'tests'; - break; - } + $pluginPath = App::pluginPath($category); + if (is_dir($pluginPath . 'tests')) { + $folder = $pluginPath . 'tests' . DS . $typeDir . DS; } } return $folder; } -/** - * Sets some get vars needed for TestManager - * - * @return void - * @access private - */ - function __setGetVars() { - if (in_array($this->category, $this->plugins)) { - $_GET['plugin'] = $this->category; - } elseif (in_array(Inflector::Humanize($this->category), $this->plugins)) { - $_GET['plugin'] = Inflector::Humanize($this->category); - } elseif ($this->category == 'app') { - $_GET['app'] = true; - } - if ($this->type == 'group') { - $_GET['group'] = true; - } - } - /** * tries to install simpletest and exits gracefully if it is not there * @@ -368,7 +363,7 @@ class TestSuiteShell extends Shell { */ function __installSimpleTest() { if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) { - $this->err('Sorry, Simpletest could not be found. Download it from http://simpletest.org and install it to your vendors directory.'); + $this->err(__('Sorry, Simpletest could not be found. Download it from http://simpletest.org and install it to your vendors directory.', true)); exit; } } diff --git a/cake/console/templates/default/views/form.ctp b/cake/console/templates/default/views/form.ctp index a86f034cc..1f445f2a3 100644 --- a/cake/console/templates/default/views/form.ctp +++ b/cake/console/templates/default/views/form.ctp @@ -43,6 +43,7 @@ ?>
+

"; ?>

\ No newline at end of file diff --git a/cake/tests/lib/header.php b/cake/tests/lib/templates/header.php similarity index 94% rename from cake/tests/lib/header.php rename to cake/tests/lib/templates/header.php index ab521a69f..3e69e898a 100644 --- a/cake/tests/lib/header.php +++ b/cake/tests/lib/templates/header.php @@ -21,7 +21,7 @@ - + CakePHP Test Suite 1.3 - +
diff --git a/cake/tests/lib/content.php b/cake/tests/lib/templates/menu.php similarity index 93% rename from cake/tests/lib/content.php rename to cake/tests/lib/templates/menu.php index 8fd087474..2a5b86219 100644 --- a/cake/tests/lib/content.php +++ b/cake/tests/lib/templates/menu.php @@ -21,7 +21,7 @@
  • - App + App
    • Test Groups
    • Test Cases
    • @@ -31,7 +31,7 @@ if (!empty($plugins)): ?>
    • - Plugins + Plugins diff --git a/cake/tests/lib/simpletest.php b/cake/tests/lib/templates/simpletest.php similarity index 88% rename from cake/tests/lib/simpletest.php rename to cake/tests/lib/templates/simpletest.php index 74ef5a75b..2e9782584 100644 --- a/cake/tests/lib/simpletest.php +++ b/cake/tests/lib/templates/simpletest.php @@ -1,6 +1,6 @@ +

      SimpleTest is not installed

      You must install SimpleTest to use the CakePHP(tm) Test Suite.

      @@ -27,4 +28,5 @@
    • vendors

    Download SimpleTest

    -
\ No newline at end of file +
+ \ No newline at end of file diff --git a/cake/tests/lib/xdebug.php b/cake/tests/lib/templates/xdebug.php similarity index 65% rename from cake/tests/lib/xdebug.php rename to cake/tests/lib/templates/xdebug.php index 688d15f87..6367827e0 100644 --- a/cake/tests/lib/xdebug.php +++ b/cake/tests/lib/templates/xdebug.php @@ -1,6 +1,6 @@ -
-

Xdebug is not installed

-

You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation.

-

Learn How To Install Xdebug

\ No newline at end of file + +
+

Xdebug is not installed

+

You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation.

+

Learn How To Install Xdebug

+
+ \ No newline at end of file diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 1745469ed..21ee551ca 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -1,6 +1,6 @@ _getTestFileList($manager->_getTestsPath()); - if ($manager->appTest) { + $testCases =& $this->_getTestFileList($this->_getTestsPath()); + if ($this->appTest) { $test =& new TestSuite('All App Tests'); - } else if ($manager->pluginTest) { - $test =& new TestSuite('All ' . Inflector::humanize($manager->pluginTest) . ' Plugin Tests'); + } else if ($this->pluginTest) { + $test =& new TestSuite('All ' . Inflector::humanize($this->pluginTest) . ' Plugin Tests'); } else { $test =& new TestSuite('All Core Tests'); } @@ -99,15 +122,14 @@ class TestManager { /** * Runs a specific test case file * - * @param string $testCaseFile - * @param string $reporter - * @return void + * @param string $testCaseFile Filename of the test to be run. + * @param Object $reporter Reporter instance to attach to the test case. + * @param boolean $testing Set to true if testing, otherwise test case will be run. + * @return mixed Result of test case being run. * @access public */ function runTestCase($testCaseFile, &$reporter, $testing = false) { - $manager =& new TestManager(); - - $testCaseFileWithPath = $manager->_getTestsPath() . DS . $testCaseFile; + $testCaseFileWithPath = $this->_getTestsPath() . DS . $testCaseFile; if (!file_exists($testCaseFileWithPath)) { trigger_error("Test case {$testCaseFile} cannot be found", E_USER_ERROR); @@ -126,14 +148,13 @@ class TestManager { /** * Runs a specific group test file * - * @param string $groupTestName - * @param string $reporter - * @return void + * @param string $groupTestName GroupTest that you want to run. + * @param Object $reporter Reporter instance to use with the group test being run. + * @return mixed Results of group test being run. * @access public */ function runGroupTest($groupTestName, &$reporter) { - $manager =& new TestManager(); - $filePath = $manager->_getTestsPath('groups') . DS . strtolower($groupTestName) . $manager->_groupExtension; + $filePath = $this->_getTestsPath('groups') . DS . strtolower($groupTestName) . $this->_groupExtension; if (!file_exists($filePath)) { trigger_error("Group test {$groupTestName} cannot be found at {$filePath}", E_USER_ERROR); @@ -141,7 +162,7 @@ class TestManager { require_once $filePath; $test =& new TestSuite($groupTestName . ' group test'); - foreach ($manager->_getGroupTestClassNames($filePath) as $groupTest) { + foreach ($this->_getGroupTestClassNames($filePath) as $groupTest) { $testCase = new $groupTest(); $test->addTestCase($testCase); if (isset($testCase->label)) { @@ -154,10 +175,11 @@ class TestManager { /** * Adds all testcases in a given directory to a given GroupTest object * - * @param string $groupTest - * @param string $directory + * @param object $groupTest Instance of TestSuite/GroupTest that files are to be added to. + * @param string $directory The directory to add tests from. * @return void * @access public + * @static */ function addTestCasesFromDirectory(&$groupTest, $directory = '.') { $manager =& new TestManager(); @@ -170,18 +192,19 @@ class TestManager { /** * Adds a specific test file and thereby all of its test cases and group tests to a given group test file * - * @param string $groupTest - * @param string $file + * @param object $groupTest Instance of TestSuite/GroupTest that a file should be added to. + * @param string $file The file name, minus the suffix to add. * @return void * @access public + * @static */ function addTestFile(&$groupTest, $file) { $manager =& new TestManager(); - if (file_exists($file.'.test.php')) { - $file .= '.test.php'; - } elseif (file_exists($file.'.group.php')) { - $file .= '.group.php'; + if (file_exists($file . $manager->_testExtension)) { + $file .= $manager->_testExtension; + } elseif (file_exists($file . $manager->_groupExtension)) { + $file .= $manager->_groupExtension; } $groupTest->addTestFile($file); } @@ -190,6 +213,7 @@ class TestManager { * Returns a list of test cases found in the current valid test case path * * @access public + * @static */ function &getTestCaseList() { $manager =& new TestManager(); @@ -200,7 +224,8 @@ class TestManager { /** * Builds the list of test cases from a given directory * - * @access public + * @param string $directory Directory to get test case list from. + * @access protected */ function &_getTestCaseList($directory = '.') { $fileList =& $this->_getTestFileList($directory); @@ -214,7 +239,8 @@ class TestManager { /** * Returns a list of test files from a given directory * - * @access public + * @param string $directory Directory to get test case files from. + * @access protected */ function &_getTestFileList($directory = '.') { $return = $this->_getRecursiveFileList($directory, array(&$this, '_isTestCaseFile')); @@ -225,6 +251,7 @@ class TestManager { * Returns a list of group tests found in the current valid test case path * * @access public + * @static */ function &getGroupTestList() { $manager =& new TestManager(); @@ -235,7 +262,8 @@ class TestManager { /** * Returns a list of group test files from a given directory * - * @access public + * @param string $directory The directory to get group test files from. + * @access protected */ function &_getTestGroupFileList($directory = '.') { $return = $this->_getRecursiveFileList($directory, array(&$this, '_isTestGroupFile')); @@ -245,7 +273,8 @@ class TestManager { /** * Returns a list of group test files from a given directory * - * @access public + * @param string $directory The directory to get group tests from. + * @access protected */ function &_getTestGroupList($directory = '.') { $fileList =& $this->_getTestGroupFileList($directory); @@ -261,7 +290,8 @@ class TestManager { /** * Returns a list of class names from a group test file * - * @access public + * @param string $groupTestFile The groupTest file to scan for TestSuite classnames. + * @access protected */ function &_getGroupTestClassNames($groupTestFile) { $file = implode("\n", file($groupTestFile)); @@ -278,7 +308,9 @@ class TestManager { * Gets a recursive list of files from a given directory and matches then against * a given fileTestFunction, like isTestCaseFile() * - * @access public + * @param string $directory The directory to scan for files. + * @param mixed $fileTestFunction + * @access protected */ function &_getRecursiveFileList($directory = '.', $fileTestFunction) { $fileList = array(); @@ -303,8 +335,8 @@ class TestManager { * Tests if a file has the correct test case extension * * @param string $file - * @return void - * @access public + * @return boolean Whether $file is a test case. + * @access protected */ function _isTestCaseFile($file) { return $this->_hasExpectedExtension($file, $this->_testExtension); @@ -314,8 +346,8 @@ class TestManager { * Tests if a file has the correct group test extension * * @param string $file - * @return void - * @access public + * @return boolean Whether $file is a group + * @access protected */ function _isTestGroupFile($file) { return $this->_hasExpectedExtension($file, $this->_groupExtension); @@ -327,7 +359,7 @@ class TestManager { * @param string $file * @param string $extension * @return void - * @access public + * @access protected */ function _hasExpectedExtension($file, $extension) { return $extension == strtolower(substr($file, (0 - strlen($extension)))); @@ -336,9 +368,9 @@ class TestManager { /** * Returns the given path to the test files depending on a given type of tests (cases, group, ..) * - * @param string $type - * @return void - * @access public + * @param string $type either 'cases' or 'groups' + * @return string The path tests are located on + * @access protected */ function _getTestsPath($type = 'cases') { if (!empty($this->appTest)) { @@ -365,453 +397,18 @@ class TestManager { } /** - * undocumented function + * Get the extension for either 'group' or 'test' types. * - * @param string $type - * @return void + * @param string $type Type of test to get, either 'test' or 'group' + * @return string Extension suffix for test. * @access public */ function getExtension($type = 'test') { - $manager =& new TestManager(); - if ($type == 'test') { - return $manager->_testExtension; + if ($type == 'test' || $type == 'case') { + return $this->_testExtension; } - return $manager->_groupExtension; + return $this->_groupExtension; } } -/** - * The CliTestManager ensures that the list of available files are printed in the correct cli format - * - * @package cake - * @subpackage cake.cake.tests.lib - */ -class CliTestManager extends TestManager { - -/** - * Prints the list of group tests in a cli friendly format - * - * @access public - */ - function &getGroupTestList() { - $manager =& new CliTestManager(); - $groupTests =& $manager->_getTestGroupList($manager->_getTestsPath('groups')); - $buffer = "Available Group Test:\n"; - - foreach ($groupTests as $groupTest) { - $buffer .= " " . $groupTest . "\n"; - } - return $buffer . "\n"; - } - -/** - * Prints the list of test cases in a cli friendly format - * - * @access public - */ - function &getTestCaseList() { - $manager =& new CliTestManager(); - $testCases =& $manager->_getTestCaseList($manager->_getTestsPath()); - $buffer = "Available Test Cases:\n"; - - foreach ($testCases as $testCaseFile => $testCase) { - $buffer .= " " . $testCaseFile . "\n"; - } - return $buffer . "\n"; - } -} - -/** - * The TextTestManager ensures that the list of available tests is printed as a list of urls in a text-friendly format - * - * @package cake - * @subpackage cake.cake.tests.lib - */ -class TextTestManager extends TestManager { - var $_url; - -/** - * Constructor - * - * @return void - * @access public - */ - function TextTestManager() { - parent::TestManager(); - $this->_url = $_SERVER['PHP_SELF']; - } - -/** - * Returns the base url - * - * @return void - * @access public - */ - function getBaseURL() { - return $this->_url; - } - -/** - * Returns a list of available group tests in a text-friendly format - * - * @access public - */ - function &getGroupTestList() { - $manager =& new TextTestManager(); - $groupTests =& $manager->_getTestGroupList($manager->_getTestsPath('groups')); - - $buffer = "Core Test Groups:\n"; - $urlExtra = ''; - if ($manager->appTest) { - $buffer = "App Test Groups:\n"; - $urlExtra = '&app=true'; - } else if ($manager->pluginTest) { - $buffer = Inflector::humanize($manager->pluginTest) . " Test Groups:\n"; - $urlExtra = '&plugin=' . $manager->pluginTest; - } - - $buffer .= "All tests\n" . $_SERVER['SERVER_NAME'] . $manager->getBaseURL() . "?group=all&output=txt{$urlExtra}\n"; - - foreach ((array)$groupTests as $groupTest) { - $buffer .= $_SERVER['SERVER_NAME']. $manager->getBaseURL()."?group=" . $groupTest . "&output=txt{$urlExtra}"."\n"; - } - - return $buffer; - } - -/** - * Returns a list of available test cases in a text-friendly format - * - * @access public - */ - function &getTestCaseList() { - $manager =& new TextTestManager(); - $testCases =& $manager->_getTestCaseList($manager->_getTestsPath()); - - $buffer = "Core Test Cases:\n"; - $urlExtra = ''; - if ($manager->appTest) { - $buffer = "App Test Cases:\n"; - $urlExtra = '&app=true'; - } else if ($manager->pluginTest) { - $buffer = Inflector::humanize($manager->pluginTest) . " Test Cases:\n"; - $urlExtra = '&plugin=' . $manager->pluginTest; - } - - if (1 > count($testCases)) { - $buffer .= "EMPTY"; - return $buffer; - } - - foreach ($testCases as $testCaseFile => $testCase) { - $buffer .= $_SERVER['SERVER_NAME']. $manager->getBaseURL()."?case=" . $testCase . "&output=txt"."\n"; - } - - $buffer .= "\n"; - return $buffer; - } -} - -/** - * The HtmlTestManager provides the foundation for the web-based CakePHP testsuite. - * It prints the different lists of tests and provides the interface for CodeCoverage, etc. - * - * @package cake - * @subpackage cake.cake.tests.lib - */ -class HtmlTestManager extends TestManager { - var $_url; - -/** - * Constructor - * - * @return void - * @access public - */ - function HtmlTestManager() { - parent::TestManager(); - $this->_url = $_SERVER['PHP_SELF']; - } - -/** - * Returns the current base url - * - * @return void - * @access public - */ - function getBaseURL() { - return $this->_url; - } - -/** - * Prints the links to the available group tests - * - * @access public - */ - function &getGroupTestList() { - $urlExtra = ''; - $manager =& new HtmlTestManager(); - $groupTests =& $manager->_getTestGroupList($manager->_getTestsPath('groups')); - - $buffer = "

Core Test Groups:

\n