Permalink
Browse files

Merge branch '1.3' into github-i18n

* 1.3: (137 commits)
  Updating tests to reflect SessionHelper's loss of magic inclusion.
  Removing SessionHelper's magical inclusion into the helpers array.  Use of SessionHelper must now be explicitly done. Tests updated.
  Fixing merge var test case for non magic session component.
  Fixing Pagescontroller test and removal of pageTitle from controller.
  Fixing component and controller test cases to work with less magical session component.
  Removing the magical addition of SessionComponent to components array.  This makes components more declarative, and removes magic that cannot be undone by the end developer.
  Fixing failing tests due to deleted assets.
  Removing use of subclass method 'fullTableName()' in Datasource superclass. Fixes #100.
  Updating CakeTestSuiteDispatcher parsing of .
  Adding missing </p> to Html test reporter template.
  Updating css file in skel dir.
  Fixing alignment issues in tables.
  Removing orphaned method.
  Adding 'id' attribute to hidden field generated for multiple select and multiple checkboxes. Fixes issue where invalid markup was generated in case to multiple checkboxes
  Adding php5 check to avoid errors when using __get() or __isset() methods in models
  Fixing include in test of CodeCoverageManager. Fixes #196
  Fixing var name when not have SimpleTest or XDebug installed.
  Moving skel/config/sql to skel/config/schema
  Fixing output of 'Actions' in bake templates.  Now outputs a __() call.
  Updating scaffolds to match new bake design.
  ...
  • Loading branch information...
2 parents 7e9fc9f + 1980a46 commit 589972d58175c3fdedee2cbb6802a472a33a8e3f @lorenzo lorenzo committed Jan 14, 2010
Showing with 2,466 additions and 1,783 deletions.
  1. +128 −67 app/webroot/css/cake.generic.css
  2. BIN app/webroot/img/cake.icon.gif
  3. BIN app/webroot/img/cake.icon.png
  4. +3 −80 app/webroot/test.php
  5. +11 −4 cake/console/libs/tasks/fixture.php
  6. +6 −5 cake/console/libs/tasks/model.php
  7. +38 −6 cake/console/libs/tasks/test.php
  8. +2 −2 cake/console/libs/tasks/view.php
  9. +126 −131 cake/console/libs/testsuite.php
  10. +1 −0 cake/console/templates/default/views/form.ctp
  11. +35 −33 cake/console/templates/default/views/index.ctp
  12. +1 −0 cake/console/templates/default/views/view.ctp
  13. 0 cake/console/templates/skel/config/{sql → schema}/db_acl.php
  14. 0 cake/console/templates/skel/config/{sql → schema}/db_acl.sql
  15. 0 cake/console/templates/skel/config/{sql → schema}/i18n.php
  16. 0 cake/console/templates/skel/config/{sql → schema}/i18n.sql
  17. 0 cake/console/templates/skel/config/{sql → schema}/sessions.php
  18. 0 cake/console/templates/skel/config/{sql → schema}/sessions.sql
  19. +128 −68 cake/console/templates/skel/webroot/css/cake.generic.css
  20. +5 −7 cake/console/templates/skel/webroot/index.php
  21. +4 −81 cake/console/templates/skel/webroot/test.php
  22. +0 −3 cake/libs/controller/component.php
  23. +1 −1 cake/libs/controller/components/auth.php
  24. +3 −3 cake/libs/controller/components/request_handler.php
  25. +2 −2 cake/libs/controller/controller.php
  26. +148 −139 cake/libs/l10n.php
  27. +5 −1 cake/libs/model/behaviors/acl.php
  28. +7 −6 cake/libs/model/datasources/datasource.php
  29. +27 −5 cake/libs/model/model.php
  30. +21 −0 cake/libs/router.php
  31. +42 −11 cake/libs/sanitize.php
  32. +21 −2 cake/libs/validation.php
  33. +9 −44 cake/libs/view/helpers/cache.php
  34. +12 −9 cake/libs/view/helpers/form.php
  35. +1 −0 cake/libs/view/scaffolds/edit.ctp
  36. +11 −10 cake/libs/view/scaffolds/index.ctp
  37. +1 −0 cake/libs/view/scaffolds/view.ctp
  38. +0 −4 cake/libs/view/view.php
  39. +4 −5 cake/tests/cases/dispatcher.test.php
  40. +6 −6 cake/tests/cases/libs/code_coverage_manager.test.php
  41. +1 −1 cake/tests/cases/libs/controller/component.test.php
  42. +30 −3 cake/tests/cases/libs/controller/components/auth.test.php
  43. +1 −1 cake/tests/cases/libs/controller/components/email.test.php
  44. +4 −4 cake/tests/cases/libs/controller/components/request_handler.test.php
  45. +1 −1 cake/tests/cases/libs/controller/components/security.test.php
  46. +2 −2 cake/tests/cases/libs/controller/controller.test.php
  47. +1 −1 cake/tests/cases/libs/controller/controller_merge_vars.test.php
  48. +3 −3 cake/tests/cases/libs/controller/pages_controller.test.php
  49. +2 −1 cake/tests/cases/libs/controller/scaffold.test.php
  50. +151 −157 cake/tests/cases/libs/l10n.test.php
  51. +1 −1 cake/tests/cases/libs/model/datasources/dbo_source.test.php
  52. +52 −0 cake/tests/cases/libs/router.test.php
  53. +37 −15 cake/tests/cases/libs/sanitize.test.php
  54. +6 −7 cake/tests/cases/libs/test_manager.test.php
  55. +11 −0 cake/tests/cases/libs/validation.test.php
  56. +77 −13 cake/tests/cases/libs/view/helpers/cache.test.php
  57. +32 −21 cake/tests/cases/libs/view/helpers/form.test.php
  58. +7 −7 cake/tests/cases/libs/view/helpers/html.test.php
  59. +7 −6 cake/tests/cases/libs/view/view.test.php
  60. +250 −0 cake/tests/lib/cake_test_suite_dispatcher.php
  61. +0 −60 cake/tests/lib/cake_text_reporter.php
  62. +0 −101 cake/tests/lib/cli_reporter.php
  63. +107 −90 cake/tests/lib/code_coverage_manager.php
  64. +226 −0 cake/tests/lib/reporter/cake_base_reporter.php
  65. +179 −0 cake/tests/lib/reporter/cake_cli_reporter.php
  66. +163 −56 cake/tests/lib/{cake_reporter.php → reporter/cake_html_reporter.php}
  67. +199 −0 cake/tests/lib/reporter/cake_text_reporter.php
  68. +9 −1 cake/tests/lib/{ → templates}/footer.php
  69. +2 −2 cake/tests/lib/{ → templates}/header.php
  70. +2 −2 cake/tests/lib/{content.php → templates/menu.php}
  71. +4 −2 cake/tests/lib/{ → templates}/simpletest.php
  72. +8 −5 cake/tests/lib/{ → templates}/xdebug.php
  73. +82 −485 cake/tests/lib/test_manager.php

Large diffs are not rendered by default.

Oops, something went wrong.
Deleted file not rendered
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -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 @@
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);
-
-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);
-}
-
-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();
- }
- }
+require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php';
- CakePHPTestRunMore();
- CakePHPTestAnalyzeCodeCoverage();
-} elseif (isset($_GET['case'])) {
- if ($analyzeCodeCoverage) {
- CodeCoverageManager::start($_GET['case'], CakeTestsGetReporter());
- }
-
- TestManager::runTestCase($_GET['case'], CakeTestsGetReporter());
-
- if ($analyzeCodeCoverage) {
- CodeCoverageManager::report();
- }
+$Dispatcher = new CakeTestSuiteDispatcher();
+$Dispatcher->dispatch();
- CakePHPTestRunMore();
- CakePHPTestAnalyzeCodeCoverage();
-} elseif (isset($_GET['show']) && $_GET['show'] == 'cases') {
- CakePHPTestCaseList();
-} else {
- CakePHPTestGroupTestList();
-}
-CakePHPTestSuiteFooter();
-$output = ob_get_clean();
-echo $output;
?>
@@ -54,13 +54,15 @@ class FixtureTask extends Shell {
* The db connection being used for baking
*
* @var string
+ * @access public
*/
var $connection = null;
/**
* Schema instance
*
* @var object
+ * @access protected
*/
var $_Schema = null;
@@ -140,6 +142,7 @@ function __interactive() {
*
* @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 @@ function importOptions($modelName) {
* @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 @@ function bake($model, $useTable = false, $importOptions = array()) {
*
* @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 @@ function generateFixtureFile($model, $otherVars) {
*
* @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 @@ function _generateSchema($tableInfo) {
*
* @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 @@ function _generateRecords($tableInfo, $recordCount = 1) {
*
* @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 @@ function _makeRecordString($records) {
* @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 @@ function _getRecordsFromTable($modelName, $useTable = null) {
'recursive' => -1
));
$db =& ConnectionManager::getDataSource($modelObject->useDbConfig);
- $schema = $modelObject->schema();
+ $schema = $modelObject->schema(true);
$out = array();
foreach ($records as $record) {
$row = array();
@@ -186,7 +186,7 @@ function __interactive() {
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 @@ function doAssociations(&$model) {
$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 @@ function doAssociations(&$model) {
* @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 @@ function findHasAndBelongsToMany(&$model, $associations) {
$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 @@ function _generatePossibleKeys() {
$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 @@ function getAllTables($useDbConfig = null) {
$tables = array();
$db =& ConnectionManager::getDataSource($useDbConfig);
+ $db->cacheSources = false;
$usePrefix = empty($db->config['prefix']) ? '' : $db->config['prefix'];
if ($usePrefix) {
foreach ($db->listSources() as $table) {
Oops, something went wrong.

0 comments on commit 589972d

Please sign in to comment.