Permalink
Browse files

Merge branch '1.3' into merger

Conflicts:
	app/Config/acl.ini.php
	app/config/database.php.default
	app/webroot/css.php
	app/webroot/css/cake.generic.css
	cake/basics.php
	cake/bootstrap.php
	cake/config/paths.php
	cake/console/cake.php
	cake/console/error.php
	cake/console/libs/acl.php
	cake/console/libs/bake.php
	cake/console/libs/i18n.php
	cake/console/libs/shell.php
	cake/console/libs/tasks/extract.php
	cake/console/libs/tasks/plugin.php
	cake/console/libs/tasks/project.php
	cake/console/libs/testsuite.php
	cake/console/templates/default/classes/test.ctp
	cake/console/templates/default/views/home.ctp
	cake/console/templates/default/views/view.ctp
	cake/console/templates/skel/config/database.php.default
	cake/console/templates/skel/views/elements/email/text/default.ctp
	cake/console/templates/skel/webroot/css.php
	cake/dispatcher.php
	cake/libs/cache.php
	cake/libs/cake_session.php
	cake/libs/configure.php
	cake/libs/controller/component.php
	cake/libs/controller/components/auth.php
	cake/libs/controller/components/email.php
	cake/libs/controller/components/request_handler.php
	cake/libs/controller/components/security.php
	cake/libs/controller/controller.php
	cake/libs/controller/scaffold.php
	cake/libs/error.php
	cake/libs/magic_db.php
	cake/libs/model/behaviors/acl.php
	cake/libs/model/connection_manager.php
	cake/libs/model/datasources/dbo/dbo_mysqli.php
	cake/libs/model/model_behavior.php
	cake/libs/overloadable.php
	cake/libs/overloadable_php4.php
	cake/libs/overloadable_php5.php
	cake/libs/router.php
	cake/libs/view/errors/missing_action.ctp
	cake/libs/view/errors/missing_behavior_class.ctp
	cake/libs/view/errors/missing_behavior_file.ctp
	cake/libs/view/errors/missing_component_class.ctp
	cake/libs/view/errors/missing_component_file.ctp
	cake/libs/view/errors/missing_connection.ctp
	cake/libs/view/errors/missing_controller.ctp
	cake/libs/view/errors/missing_helper_class.ctp
	cake/libs/view/errors/missing_helper_file.ctp
	cake/libs/view/errors/missing_layout.ctp
	cake/libs/view/errors/missing_model.ctp
	cake/libs/view/errors/missing_scaffolddb.ctp
	cake/libs/view/errors/missing_table.ctp
	cake/libs/view/errors/missing_view.ctp
	cake/libs/view/errors/private_action.ctp
	cake/libs/view/errors/scaffold_error.ctp
	cake/libs/view/helpers/ajax.php
	cake/libs/view/helpers/javascript.php
	cake/libs/view/helpers/js.php
	cake/libs/view/helpers/session.php
	cake/libs/view/helpers/xml.php
	cake/libs/view/media.php
	cake/libs/view/pages/home.ctp
	cake/libs/view/scaffolds/edit.ctp
	cake/libs/view/scaffolds/index.ctp
	cake/libs/view/scaffolds/view.ctp
	cake/libs/view/view.php
	cake/libs/xml.php
	cake/tests/cases/console/cake.test.php
	cake/tests/cases/console/libs/acl.test.php
	cake/tests/cases/console/libs/api.test.php
	cake/tests/cases/console/libs/bake.test.php
	cake/tests/cases/console/libs/shell.test.php
	cake/tests/cases/console/libs/tasks/controller.test.php
	cake/tests/cases/console/libs/tasks/db_config.test.php
	cake/tests/cases/console/libs/tasks/fixture.test.php
	cake/tests/cases/console/libs/tasks/model.test.php
	cake/tests/cases/console/libs/tasks/plugin.test.php
	cake/tests/cases/console/libs/tasks/project.test.php
	cake/tests/cases/console/libs/tasks/test.test.php
	cake/tests/cases/console/libs/tasks/view.test.php
	cake/tests/cases/dispatcher.test.php
	cake/tests/cases/libs/cache/apc.test.php
	cake/tests/cases/libs/cake_session.test.php
	cake/tests/cases/libs/cake_test_case.test.php
	cake/tests/cases/libs/code_coverage_manager.test.php
	cake/tests/cases/libs/configure.test.php
	cake/tests/cases/libs/controller/component.test.php
	cake/tests/cases/libs/controller/components/auth.test.php
	cake/tests/cases/libs/controller/components/cookie.test.php
	cake/tests/cases/libs/controller/components/request_handler.test.php
	cake/tests/cases/libs/controller/components/session.test.php
	cake/tests/cases/libs/controller/controller.test.php
	cake/tests/cases/libs/controller/pages_controller.test.php
	cake/tests/cases/libs/error.test.php
	cake/tests/cases/libs/http_socket.test.php
	cake/tests/cases/libs/magic_db.test.php
	cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php
	cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php
	cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php
	cake/tests/cases/libs/model/datasources/dbo_source.test.php
	cake/tests/cases/libs/model/models.php
	cake/tests/cases/libs/overloadable.test.php
	cake/tests/cases/libs/test_manager.test.php
	cake/tests/cases/libs/view/helpers/ajax.test.php
	cake/tests/cases/libs/view/helpers/javascript.test.php
	cake/tests/cases/libs/view/helpers/session.test.php
	cake/tests/cases/libs/view/helpers/xml.test.php
	cake/tests/cases/libs/view/media.test.php
	cake/tests/cases/libs/view/theme.test.php
	cake/tests/cases/libs/xml.test.php
	cake/tests/fixtures/aco_fixture.php
	cake/tests/fixtures/translate_fixture.php
	cake/tests/groups/acl.group.php
	cake/tests/groups/bake.group.php
	cake/tests/groups/behaviors.group.php
	cake/tests/groups/cache.group.php
	cake/tests/groups/components.group.php
	cake/tests/groups/configure.group.php
	cake/tests/groups/console.group.php
	cake/tests/groups/controller.group.php
	cake/tests/groups/database.group.php
	cake/tests/groups/helpers.group.php
	cake/tests/groups/i18n.group.php
	cake/tests/groups/javascript.group.php
	cake/tests/groups/lib.group.php
	cake/tests/groups/model.group.php
	cake/tests/groups/no_cross_contamination.group.php
	cake/tests/groups/routing_system.group.php
	cake/tests/groups/socket.group.php
	cake/tests/groups/test_suite.group.php
	cake/tests/groups/view.group.php
	cake/tests/groups/xml.group.php
	cake/tests/lib/cake_test_case.php
	cake/tests/lib/cake_test_model.php
	cake/tests/lib/cake_test_suite_dispatcher.php
	cake/tests/lib/cake_web_test_case.php
	cake/tests/lib/code_coverage_manager.php
	cake/tests/lib/reporter/cake_base_reporter.php
	cake/tests/lib/reporter/cake_cli_reporter.php
	cake/tests/lib/reporter/cake_text_reporter.php
	cake/tests/lib/templates/menu.php
	cake/tests/lib/templates/simpletest.php
	cake/tests/lib/test_manager.php
	cake/tests/test_app/controllers/tests_apps_controller.php
	cake/tests/test_app/libs/cache/test_app_cache.php
	cake/tests/test_app/libs/library.php
	cake/tests/test_app/libs/log/test_app_log.php
	cake/tests/test_app/plugins/test_plugin/config/load.php
	cake/tests/test_app/plugins/test_plugin/config/more.load.php
	cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php
	cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php
	cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php
	cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php
	cake/tests/test_app/plugins/test_plugin/controllers/test_plugin_controller.php
	cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php
	cake/tests/test_app/plugins/test_plugin/libs/cache/test_plugin_cache.php
	cake/tests/test_app/plugins/test_plugin/libs/log/test_plugin_log.php
	cake/tests/test_app/plugins/test_plugin/libs/test_plugin_library.php
	cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php
	cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php
	cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php
	cake/tests/test_app/plugins/test_plugin/vendors/welcome.php
	cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php
	cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php
	cake/tests/test_app/vendors/Test/MyTest.php
	cake/tests/test_app/vendors/Test/hello.php
	cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php
	cake/tests/test_app/vendors/shells/sample.php
	cake/tests/test_app/vendors/somename/some.name.php
	cake/tests/test_app/vendors/welcome.php
	cake/tests/test_app/views/elements/email/text/default.ctp
	cake/tests/test_app/views/layouts/default.ctp
	cake/tests/test_app/views/posts/test_nocache_tags.ctp
	lib/Cake/Cache/Engine/MemcacheEngine.php
	lib/Cake/Config/config.php
	lib/Cake/Console/Command/Task/ModelTask.php
	lib/Cake/Console/Templates/skel/webroot/css/cake.generic.css
	lib/Cake/Console/Templates/skel/webroot/test.php
	lib/Cake/Console/cake.bat
	lib/Cake/Controller/Component/CookieComponent.php
	lib/Cake/Log/CakeLog.php
	lib/Cake/Model/CakeSchema.php
	lib/Cake/Test/Case/Log/Engine/FileLog.php
	lib/Cake/Test/Case/View/Helper/FormHelperTest.php
	lib/Cake/Test/test_app/View/Emails/html/custom.ctp
	lib/Cake/Test/test_app/View/Emails/text/custom.ctp
	lib/Cake/TestSuite/templates/header.php
	lib/Cake/Utility/Sanitize.php
	lib/Cake/Utility/Validation.php
	lib/Cake/VERSION.txt
	lib/Cake/View/Helper/FormHelper.php
  • Loading branch information...
2 parents e33a9a7 + de893b1 commit 91a1cf81f354627f8a809e3777bd72d7e515a49a @markstory markstory committed Jun 23, 2011
Showing with 253 additions and 47 deletions.
  1. +1 −1 app/Config/acl.ini.php
  2. +1 −0 app/Config/core.php
  3. +80 −0 app/config/database.php.default
  4. BIN app/webroot/img/test-error-icon.png
  5. BIN app/webroot/img/test-fail-icon.png
  6. BIN app/webroot/img/test-pass-icon.png
  7. BIN app/webroot/img/test-skip-icon.png
  8. +1 −1 lib/Cake/Cache/Engine/FileEngine.php
  9. +3 −3 lib/Cake/Cache/Engine/MemcacheEngine.php
  10. +0 −1 lib/Cake/Config/config.php
  11. +5 −0 lib/Cake/Console/Command/Task/ControllerTask.php
  12. +3 −0 lib/Cake/Console/Command/Task/ModelTask.php
  13. +1 −0 lib/Cake/Console/Templates/skel/Config/core.php
  14. +1 −1 lib/Cake/Console/Templates/skel/webroot/css/cake.generic.css
  15. BIN lib/Cake/Console/Templates/skel/webroot/img/img/test-error-icon.png
  16. BIN lib/Cake/Console/Templates/skel/webroot/img/img/test-fail-icon.png
  17. BIN lib/Cake/Console/Templates/skel/webroot/img/img/test-pass-icon.png
  18. BIN lib/Cake/Console/Templates/skel/webroot/img/img/test-skip-icon.png
  19. +1 −1 lib/Cake/Console/cake.bat
  20. +4 −3 lib/Cake/Controller/Component/CookieComponent.php
  21. +1 −1 lib/Cake/Model/Behavior/AclBehavior.php
  22. +15 −4 lib/Cake/Model/CakeSchema.php
  23. +1 −1 lib/Cake/Model/Datasource/Database/Sqlite.php
  24. +1 −1 lib/Cake/Model/Datasource/DboSource.php
  25. +2 −1 lib/Cake/Test/Case/Cache/Engine/MemcacheTest.php
  26. +10 −0 lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php
  27. +10 −1 lib/Cake/Test/Case/Model/CakeSchemaTest.php
  28. +1 −1 lib/Cake/Test/Case/Model/ConnectionManagerTest.php
  29. +11 −0 lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php
  30. +12 −0 lib/Cake/Test/Case/Model/models.php
  31. +1 −0 lib/Cake/Test/Case/Utility/ValidationTest.php
  32. +18 −3 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
  33. +20 −0 lib/Cake/Test/Case/View/MediaViewTest.php
  34. +35 −0 lib/Cake/Test/Fixture/PrefixTestFixture.php
  35. BIN lib/Cake/Test/test_app/Vendor/img/test_2.JPG
  36. +0 −2 lib/Cake/Test/test_app/View/Emails/html/custom.ctp
  37. +0 −2 lib/Cake/Test/test_app/View/Emails/text/custom.ctp
  38. +1 −1 lib/Cake/Test/test_app/View/Layouts/multi_cache.ctp
  39. +1 −1 lib/Cake/Test/test_app/View/Posts/sequencial_nocache.ctp
  40. +4 −4 lib/Cake/TestSuite/templates/header.php
  41. +1 −1 lib/Cake/Utility/Folder.php
  42. +1 −1 lib/Cake/Utility/Inflector.php
  43. +1 −0 lib/Cake/Utility/Sanitize.php
  44. +1 −1 lib/Cake/Utility/Validation.php
  45. +0 −5 lib/Cake/VERSION.txt
  46. +1 −1 lib/Cake/View/Errors/error400.ctp
  47. +1 −1 lib/Cake/View/Errors/error500.ctp
  48. +1 −2 lib/Cake/View/Helper/FormHelper.php
  49. +1 −1 lib/Cake/View/Helper/NumberHelper.php
View
@@ -6,7 +6,7 @@
; *
; * PHP 5
; *
-; * CakePHP(tm) : Rapid Development Framework http://www.cakephp.org/
+; * CakePHP(tm) : Rapid Development Framework http://cakephp.org
; * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
; *
; * Licensed under The MIT License
View
@@ -281,6 +281,7 @@
* ), //[optional]
* 'persistent' => true, // [optional] set this to false for non-persistent connections
* 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory)
+ * 'persistent' => true, // [optional] set this to false for non-persistent connections
* ));
*
*/
@@ -0,0 +1,80 @@
+<?php
+/**
+ * This is core configuration file.
+ *
+ * Use it to configure core behaviour of Cake.
+ *
+ * PHP 5
+ *
+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
+ * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @link http://cakephp.org CakePHP(tm) Project
+ * @package app.config
+ * @since CakePHP(tm) v 0.2.9
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
+ */
+/**
+ * In this file you set up your database connection details.
+ *
+ * @package cake.config
+ */
+/**
+ * Database configuration class.
+ * You can specify multiple configurations for production, development and testing.
+ *
+ * driver => The name of a supported driver; valid options are as follows:
+ * Database/Mysql - MySQL 4 & 5,
+ * Database/Sqlite - SQLite (PHP5 only),
+ * Database/Postgres - PostgreSQL 7 and higher,
+ * Database/Sqlserver - Microsoft SQL Server 2005 and higher,
+ * Database/Oracle - Oracle 8 and higher
+ *
+ * You can add custom database drivers (or override existing drivers) by adding the
+ * appropriate file to app/Model/Datasource/Database. Drivers should be named 'MyDriver.php',
+ *
+ *
+ * persistent => true / false
+ * Determines whether or not the database should use a persistent connection
+ *
+ * host =>
+ * the host you connect to the database. To add a socket or port number, use 'port' => #
+ *
+ * prefix =>
+ * Uses the given prefix for all the tables in this database. This setting can be overridden
+ * on a per-table basis with the Model::$tablePrefix property.
+ *
+ * schema =>
+ * For Postgres specifies which schema you would like to use the tables in. Postgres defaults to 'public'.
+ *
+ * encoding =>
+ * For MySQL, Postgres specifies the character encoding to use when connecting to the
+ * database. Uses database default not specified.
+ *
+ */
+class DATABASE_CONFIG {
+
+ public $default = array(
+ 'datasource' => 'Database/Mysql',
+ 'persistent' => false,
+ 'host' => 'localhost',
+ 'login' => 'user',
+ 'password' => 'password',
+ 'database' => 'database_name',
+ 'prefix' => '',
+ );
+
+ public $test = array(
+ 'datasource' => 'Database/Mysql',
+ 'persistent' => false,
+ 'host' => 'localhost',
+ 'login' => 'user',
+ 'password' => 'password',
+ 'database' => 'test_database_name',
+ 'prefix' => '',
+ );
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -302,4 +302,4 @@ protected function _active() {
}
return true;
}
-}
+}
@@ -64,8 +64,8 @@ public function init($settings = array()) {
'engine'=> 'Memcache',
'prefix' => Inflector::slug(APP_DIR) . '_',
'servers' => array('127.0.0.1'),
- 'persistent' => true,
- 'compress'=> false
+ 'compress'=> false,
+ 'persistent' => true
), $settings)
);
@@ -211,4 +211,4 @@ public function connect($host, $port = 11211) {
}
return true;
}
-}
+}
@@ -16,5 +16,4 @@
* @since CakePHP(tm) v 1.1.11.4062
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-
return $config['Cake.version'] = '2.0.0-alpha';
@@ -477,6 +477,11 @@ public function help() {
$this->out("\tName of the controller to bake. Can use Plugin.name");
$this->out("\tas a shortcut for plugin baking.");
$this->out();
+ $this->out('Params:');
+ $this->out();
+ $this->out('-connection <config>');
+ $this->out("\tset db config <config>. uses 'default' if none is specified");
+ $this->out();
$this->out('Commands:');
$this->out();
$this->out("controller <name>");
@@ -356,6 +356,7 @@ public function initValidations() {
$default++;
}
}
+ $choices[$default] = 'none'; // Needed since index starts at 1
$this->_validations = $choices;
return $choices;
}
@@ -394,6 +395,8 @@ public function fieldValidation($fieldName, $metaData, $primaryKey = 'id') {
if ($metaData['null'] != 1 && !in_array($fieldName, array($primaryKey, 'created', 'modified', 'updated'))) {
if ($fieldName == 'email') {
$guess = $methods['email'];
+ } elseif ($metaData['type'] == 'string' && $metaData['length'] == 36) {
+ $guess = $methods['uuid'];
} elseif ($metaData['type'] == 'string') {
$guess = $methods['notempty'];
} elseif ($metaData['type'] == 'integer') {
@@ -281,6 +281,7 @@
* ), //[optional]
* 'persistent' => true, // [optional] set this to false for non-persistent connections
* 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory)
+ * 'persistent' => true, // [optional] set this to false for non-persistent connections
* ));
*
*/
@@ -533,5 +533,5 @@ div.code-coverage-results span.result-good {
/** Elements **/
#url-rewriting-warning {
- display:none;
+ display: none;
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -29,4 +29,4 @@ php -q "%lib%cake.php" -working "%CD% " %*
echo.
-exit /B %ERRORLEVEL%
+exit /B %ERRORLEVEL%
@@ -286,14 +286,15 @@ public function delete($key) {
foreach ($this->_values[$key] as $idx => $val) {
$this->_delete("[$key][$idx]");
}
- } else {
- $this->_delete("[$key]");
}
+ $this->_delete("[$key]");
unset($this->_values[$key]);
return;
}
$names = explode('.', $key, 2);
- $this->_values[$names[0]] = Set::remove($this->_values[$names[0]], $names[1]);
+ if (isset($this->_values[$names[0]])) {
+ $this->_values[$names[0]] = Set::remove($this->_values[$names[0]], $names[1]);
+ }
$this->_delete('[' . implode('][', $names) . ']');
}
@@ -101,7 +101,7 @@ public function afterSave($model, $created) {
}
$data = array(
'parent_id' => isset($parent[0][$type]['id']) ? $parent[0][$type]['id'] : null,
- 'model' => $model->alias,
+ 'model' => $model->name,
'foreign_key' => $model->id
);
if (!$created) {
@@ -254,7 +254,7 @@ public function read($options = array()) {
if ($prefix && strpos($table, $prefix) !== 0) {
continue;
}
- $table = str_replace($prefix, '', $table);
+ $table = $this->_noPrefixTable($prefix, $table);
if (in_array($fulltable, $currentTables)) {
$key = array_search($fulltable, $currentTables);
@@ -276,8 +276,8 @@ public function read($options = array()) {
}
if (in_array($withTable, $currentTables)) {
$key = array_search($withTable, $currentTables);
- $noPrefixWith = str_replace($prefix, '', $withTable);
-
+ $noPrefixWith = $this->_noPrefixTable($prefix, $withTable);
+
$tables[$noPrefixWith] = $this->__columns($Object->$class);
$tables[$noPrefixWith]['indexes'] = $db->index($Object->$class);
$tables[$noPrefixWith]['tableParameters'] = $db->readTableParameters($withTable);
@@ -297,7 +297,7 @@ public function read($options = array()) {
if (strpos($table, $prefix) !== 0) {
continue;
}
- $table = str_replace($prefix, '', $table);
+ $table = $this->_noPrefixTable($prefix, $table);
}
$Object = new AppModel(array(
'name' => Inflector::classify($table), 'table' => $table, 'ds' => $connection
@@ -684,4 +684,15 @@ protected function _compareIndexes($new, $old) {
}
return array_filter(compact('add', 'drop'));
}
+
+/**
+ * Trim the table prefix from the full table name, and return the prefix-less table
+ *
+ * @param string $prefix Table prefix
+ * @param string $table Full table name
+ * @return string Prefix-less table name
+ */
+ function _noPrefixTable($prefix, $table) {
+ return preg_replace('/^' . preg_quote($prefix) . '/', '', $table);
+ }
}
@@ -554,4 +554,4 @@ public function dropSchema(CakeSchema $schema, $table = null) {
}
return $out;
}
-}
+}
@@ -2677,7 +2677,7 @@ public function group($group, $model = null) {
$group = array($group);
}
foreach($group as $index => $key) {
- if ($model->isVirtualField($key)) {
+ if (is_object($model) && $model->isVirtualField($key)) {
$group[$index] = '(' . $model->getVirtualField($key) . ')';
}
}
@@ -89,7 +89,8 @@ public function testSettings() {
'servers' => array('127.0.0.1'),
'persistent' => true,
'compress' => false,
- 'engine' => 'Memcache'
+ 'engine' => 'Memcache',
+ 'persistent' => true,
);
$this->assertEqual($settings, $expecting);
}
@@ -514,6 +514,16 @@ public function testDeleteRemovesChildren() {
$this->Cookie->destroy();
}
/**
+ * Test deleting recursively with keys that don't exist.
+ *
+ * @return void
+ */
+ function testDeleteChildrenNotExist() {
+ $this->assertNull($this->Controller->Cookie->delete('NotFound'));
+ $this->assertNull($this->Controller->Cookie->delete('Not.Found'));
+ }
+
+/**
* Helper method for generating old style encoded cookie values.
*
* @return string.
@@ -505,7 +505,8 @@ class CakeSchemaTest extends CakeTestCase {
public $fixtures = array(
'core.post', 'core.tag', 'core.posts_tag', 'core.test_plugin_comment',
'core.datatype', 'core.auth_user', 'core.author',
- 'core.test_plugin_article', 'core.user', 'core.comment'
+ 'core.test_plugin_article', 'core.user', 'core.comment',
+ 'core.prefix_test'
);
/**
@@ -658,6 +659,14 @@ public function testSchemaReadWithConfigPrefix() {
ConnectionManager::create('schema_prefix', $config);
$read = $this->Schema->read(array('connection' => 'schema_prefix', 'models' => false));
$this->assertTrue(empty($read['tables']));
+
+ $config['prefix'] = 'prefix_';
+ ConnectionManager::create('schema_prefix2', $config);
+ $read = $this->Schema->read(array(
+ 'connection' => 'schema_prefix2',
+ 'name' => 'TestApp',
+ 'models' => false));
+ $this->assertTrue(isset($read['tables']['prefix_tests']));
}
/**
@@ -5,7 +5,7 @@
*
* PHP 5
*
- * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
@@ -852,4 +852,15 @@ public function testStatements() {
$result = $this->testDb->hasAny($Article, '1=2');
$this->assertFalse($result);
}
+
+/**
+ * Test that group works without a model
+ *
+ * @return void
+ */
+ function testGroupNoModel() {
+ $result = $this->db->group('created');
+ $this->assertEqual(' GROUP BY created', $result);
+ }
+
}
@@ -4734,3 +4734,15 @@ public function schema($field = false) {
);
}
}
+
+/**
+ * Test model for datasource prefixes
+ *
+ */
+class PrefixTestModel extends CakeTestModel {
+}
+class PrefixTestUseTableModel extends CakeTestModel {
+ var $name = 'PrefixTest';
+ var $useTable = 'prefix_tests';
+}
+
@@ -1813,6 +1813,7 @@ public function testUrl() {
$this->assertTrue(Validation::url('http://www.zwischenraume.de'));
$this->assertTrue(Validation::url('http://www.zwischenraume.cz'));
$this->assertTrue(Validation::url('http://www.last.fm/music/浜崎あゆみ'), 'utf8 path failed');
+ $this->assertTrue(Validation::url('http://www.electrohome.ro/images/239537750-284232-215_300[1].jpg'));
$this->assertTrue(Validation::url('http://cakephp.org:80'));
$this->assertTrue(Validation::url('http://cakephp.org:443'));
Oops, something went wrong.

0 comments on commit 91a1cf8

Please sign in to comment.