Permalink
Browse files

Merge branch '2.1' into 2.2

  • Loading branch information...
2 parents 34e1afd + 4a6159c commit d748fc745198dea42f124613b6ae70f90b566aa4 @ceeram ceeram committed Mar 23, 2012
Showing with 1,984 additions and 1,983 deletions.
  1. +1 −0 lib/Cake/Model/CakeSchema.php
  2. +0 −2 lib/Cake/Model/Datasource/CakeSession.php
  3. +3 −1 lib/Cake/Model/Datasource/Database/Sqlite.php
  4. +11 −11 lib/Cake/Test/Case/BasicsTest.php
  5. +10 −10 lib/Cake/Test/Case/Cache/CacheTest.php
  6. +2 −2 lib/Cake/Test/Case/Cache/Engine/ApcEngineTest.php
  7. +9 −9 lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php
  8. +13 −13 lib/Cake/Test/Case/Cache/Engine/MemcacheEngineTest.php
  9. +2 −2 lib/Cake/Test/Case/Cache/Engine/WincacheEngineTest.php
  10. +2 −2 lib/Cake/Test/Case/Cache/Engine/XcacheEngineTest.php
  11. +1 −1 lib/Cake/Test/Case/Configure/IniReaderTest.php
  12. +16 −16 lib/Cake/Test/Case/Console/Command/AclShellTest.php
  13. +11 −11 lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
  14. +2 −2 lib/Cake/Test/Case/Console/Command/Task/ControllerTaskTest.php
  15. +1 −1 lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php
  16. +3 −3 lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php
  17. +3 −3 lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php
  18. +8 −8 lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php
  19. +2 −2 lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
  20. +3 −3 lib/Cake/Test/Case/Console/Command/Task/ViewTaskTest.php
  21. +1 −1 lib/Cake/Test/Case/Console/Command/TestShellTest.php
  22. +8 −8 lib/Cake/Test/Case/Console/ShellDispatcherTest.php
  23. +19 −19 lib/Cake/Test/Case/Console/ShellTest.php
  24. +3 −3 lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php
  25. +5 −5 lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php
  26. +26 −26 lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php
  27. +1 −1 lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php
  28. +43 −43 lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php
  29. +18 −18 lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php
  30. +2 −2 lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php
  31. +10 −10 lib/Cake/Test/Case/Controller/Component/SessionComponentTest.php
  32. +4 −4 lib/Cake/Test/Case/Controller/ControllerMergeVarsTest.php
  33. +17 −17 lib/Cake/Test/Case/Controller/ControllerTest.php
  34. +3 −3 lib/Cake/Test/Case/Controller/PagesControllerTest.php
  35. +12 −12 lib/Cake/Test/Case/Controller/ScaffoldTest.php
  36. +13 −13 lib/Cake/Test/Case/Core/AppTest.php
  37. +10 −10 lib/Cake/Test/Case/Core/ConfigureTest.php
  38. +12 −12 lib/Cake/Test/Case/Core/ObjectTest.php
  39. +2 −2 lib/Cake/Test/Case/Error/ErrorHandlerTest.php
  40. +2 −2 lib/Cake/Test/Case/Error/ExceptionRendererTest.php
  41. +190 −190 lib/Cake/Test/Case/I18n/L10nTest.php
  42. +2 −2 lib/Cake/Test/Case/I18n/MultibyteTest.php
  43. +4 −4 lib/Cake/Test/Case/Log/CakeLogTest.php
  44. +2 −2 lib/Cake/Test/Case/Model/AclNodeTest.php
  45. +19 −19 lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php
  46. +15 −15 lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php
  47. +11 −11 lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php
  48. +1 −1 lib/Cake/Test/Case/Model/Behavior/TreeBehaviorAfterTest.php
  49. +12 −12 lib/Cake/Test/Case/Model/Behavior/TreeBehaviorNumberTest.php
  50. +8 −8 lib/Cake/Test/Case/Model/Behavior/TreeBehaviorScopedTest.php
  51. +48 −48 lib/Cake/Test/Case/Model/BehaviorCollectionTest.php
  52. +6 −6 lib/Cake/Test/Case/Model/CakeSchemaTest.php
  53. +3 −3 lib/Cake/Test/Case/Model/ConnectionManagerTest.php
  54. +8 −8 lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php
  55. +93 −93 lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
  56. +53 −53 lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php
  57. +4 −4 lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php
  58. +2 −2 lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php
  59. +26 −26 lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php
  60. +17 −17 lib/Cake/Test/Case/Model/ModelDeleteTest.php
  61. +60 −60 lib/Cake/Test/Case/Model/ModelIntegrationTest.php
  62. +46 −46 lib/Cake/Test/Case/Model/ModelReadTest.php
  63. +45 −45 lib/Cake/Test/Case/Model/ModelValidationTest.php
  64. +121 −121 lib/Cake/Test/Case/Model/ModelWriteTest.php
  65. +59 −59 lib/Cake/Test/Case/Network/CakeRequestTest.php
  66. +31 −31 lib/Cake/Test/Case/Network/CakeResponseTest.php
  67. +9 −9 lib/Cake/Test/Case/Network/CakeSocketTest.php
  68. +8 −8 lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
  69. +2 −2 lib/Cake/Test/Case/Network/Http/BasicAuthenticationTest.php
  70. +8 −8 lib/Cake/Test/Case/Network/Http/DigestAuthenticationTest.php
  71. +44 −44 lib/Cake/Test/Case/Network/Http/HttpResponseTest.php
  72. +104 −104 lib/Cake/Test/Case/Network/Http/HttpSocketTest.php
  73. +35 −35 lib/Cake/Test/Case/Routing/DispatcherTest.php
  74. +53 −53 lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php
  75. +4 −4 lib/Cake/Test/Case/Routing/Route/PluginShortRouteTest.php
  76. +10 −10 lib/Cake/Test/Case/Routing/Route/RedirectRouteTest.php
  77. +56 −56 lib/Cake/Test/Case/Routing/RouterTest.php
  78. +11 −11 lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php
  79. +19 −19 lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php
  80. +34 −34 lib/Cake/Test/Case/Utility/CakeTimeTest.php
  81. +1 −1 lib/Cake/Test/Case/Utility/ClassRegistryTest.php
  82. +4 −4 lib/Cake/Test/Case/Utility/DebuggerTest.php
  83. +1 −1 lib/Cake/Test/Case/Utility/FileTest.php
  84. +28 −28 lib/Cake/Test/Case/Utility/FolderTest.php
  85. +1 −1 lib/Cake/Test/Case/Utility/ObjectCollectionTest.php
  86. +12 −12 lib/Cake/Test/Case/Utility/SanitizeTest.php
  87. +4 −4 lib/Cake/Test/Case/Utility/SecurityTest.php
  88. +128 −128 lib/Cake/Test/Case/Utility/SetTest.php
  89. +18 −18 lib/Cake/Test/Case/Utility/StringTest.php
  90. +44 −44 lib/Cake/Test/Case/Utility/XmlTest.php
  91. +29 −29 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
  92. +14 −14 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
  93. +4 −4 lib/Cake/Test/Case/View/Helper/JqueryEngineHelperTest.php
  94. +25 −25 lib/Cake/Test/Case/View/Helper/JsHelperTest.php
  95. +6 −6 lib/Cake/Test/Case/View/Helper/MootoolsEngineHelperTest.php
  96. +8 −8 lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php
  97. +6 −6 lib/Cake/Test/Case/View/Helper/PrototypeEngineHelperTest.php
  98. +2 −2 lib/Cake/Test/Case/View/Helper/SessionHelperTest.php
  99. +32 −32 lib/Cake/Test/Case/View/HelperTest.php
  100. +20 −20 lib/Cake/Test/Case/View/ViewTest.php
@@ -20,6 +20,7 @@
App::uses('Model', 'Model');
App::uses('AppModel', 'Model');
App::uses('ConnectionManager', 'Model');
+App::uses('File', 'Utility');
/**
* Base Class for Schema management
@@ -602,9 +602,7 @@ protected static function _startSession() {
$_SESSION = array();
}
} elseif (!isset($_SESSION)) {
- session_cache_limiter ("must-revalidate");
session_start();
- header ('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');
} else {
session_start();
}
@@ -166,7 +166,9 @@ public function describe($model) {
return $cache;
}
$fields = array();
- $result = $this->_execute('PRAGMA table_info(' . $table . ')');
+ $result = $this->_execute(
+ 'PRAGMA table_info(' . $this->value($table, 'string') . ')'
+ );
foreach ($result as $column) {
$column = (array)$column;
@@ -77,7 +77,7 @@ public function testArrayDiffKey() {
$one = array('minYear' => null, 'maxYear' => null, 'separator' => '-', 'interval' => 1, 'monthNames' => true);
$two = array('minYear' => null, 'maxYear' => null, 'separator' => '-', 'interval' => 1, 'monthNames' => true);
$result = array_diff_key($one, $two);
- $this->assertEquals($result, array());
+ $this->assertEquals(array(), $result);
}
/**
@@ -282,7 +282,7 @@ public function testCache() {
$this->assertTrue(file_exists(CACHE . 'basics_test'));
$result = cache('basics_test');
- $this->assertEquals($result, 'simple cache write');
+ $this->assertEquals('simple cache write', $result);
@unlink(CACHE . 'basics_test');
cache('basics_test', 'expired', '+1 second');
@@ -874,7 +874,7 @@ public function testStripslashesDeep() {
),
'g' => 'test'
);
- $this->assertEquals(stripslashes_deep($nested), $expected);
+ $this->assertEquals($expected, stripslashes_deep($nested));
}
/**
@@ -909,7 +909,7 @@ public function testStripslashesDeepSybase() {
),
'g' => "te'''st"
);
- $this->assertEquals(stripslashes_deep($nested), $expected);
+ $this->assertEquals($expected, stripslashes_deep($nested));
}
/**
@@ -919,24 +919,24 @@ public function testStripslashesDeepSybase() {
*/
public function testPluginSplit() {
$result = pluginSplit('Something.else');
- $this->assertEquals($result, array('Something', 'else'));
+ $this->assertEquals(array('Something', 'else'), $result);
$result = pluginSplit('Something.else.more.dots');
- $this->assertEquals($result, array('Something', 'else.more.dots'));
+ $this->assertEquals(array('Something', 'else.more.dots'), $result);
$result = pluginSplit('Somethingelse');
- $this->assertEquals($result, array(null, 'Somethingelse'));
+ $this->assertEquals(array(null, 'Somethingelse'), $result);
$result = pluginSplit('Something.else', true);
- $this->assertEquals($result, array('Something.', 'else'));
+ $this->assertEquals(array('Something.', 'else'), $result);
$result = pluginSplit('Something.else.more.dots', true);
- $this->assertEquals($result, array('Something.', 'else.more.dots'));
+ $this->assertEquals(array('Something.', 'else.more.dots'), $result);
$result = pluginSplit('Post', false, 'Blog');
- $this->assertEquals($result, array('Blog', 'Post'));
+ $this->assertEquals(array('Blog', 'Post'), $result);
$result = pluginSplit('Blog.Post', false, 'Ultimate');
- $this->assertEquals($result, array('Blog', 'Post'));
+ $this->assertEquals(array('Blog', 'Post'), $result);
}
}
@@ -57,7 +57,7 @@ public function tearDown() {
public function testConfig() {
$settings = array('engine' => 'File', 'path' => TMP . 'tests', 'prefix' => 'cake_test_');
$results = Cache::config('new', $settings);
- $this->assertEquals($results, Cache::config('new'));
+ $this->assertEquals(Cache::config('new'), $results);
$this->assertTrue(isset($results['engine']));
$this->assertTrue(isset($results['settings']));
}
@@ -93,11 +93,11 @@ public function testConfigWithLibAndPluginEngines() {
$settings = array('engine' => 'TestAppCache', 'path' => TMP, 'prefix' => 'cake_test_');
$result = Cache::config('libEngine', $settings);
- $this->assertEquals($result, Cache::config('libEngine'));
+ $this->assertEquals(Cache::config('libEngine'), $result);
$settings = array('engine' => 'TestPlugin.TestPluginCache', 'path' => TMP, 'prefix' => 'cake_test_');
$result = Cache::config('pluginLibEngine', $settings);
- $this->assertEquals($result, Cache::config('pluginLibEngine'));
+ $this->assertEquals(Cache::config('pluginLibEngine'), $result);
Cache::drop('libEngine');
Cache::drop('pluginLibEngine');
@@ -161,10 +161,10 @@ public function testConfigChange() {
$_cacheConfigTests = Cache::config('tests');
$result = Cache::config('sessions', array('engine' => 'File', 'path' => TMP . 'sessions'));
- $this->assertEquals($result['settings'], Cache::settings('sessions'));
+ $this->assertEquals(Cache::settings('sessions'), $result['settings']);
$result = Cache::config('tests', array('engine' => 'File', 'path' => TMP . 'tests'));
- $this->assertEquals($result['settings'], Cache::settings('tests'));
+ $this->assertEquals(Cache::settings('tests'), $result['settings']);
Cache::config('sessions', $_cacheConfigSessions['settings']);
Cache::config('tests', $_cacheConfigTests['settings']);
@@ -180,17 +180,17 @@ public function testConfigSettingDefaultConfigKey() {
Cache::write('value_one', 'I am cached', 'test_name');
$result = Cache::read('value_one', 'test_name');
- $this->assertEquals($result, 'I am cached');
+ $this->assertEquals('I am cached', $result);
$result = Cache::read('value_one');
- $this->assertEquals($result, null);
+ $this->assertEquals(null, $result);
Cache::write('value_one', 'I am in default config!');
$result = Cache::read('value_one');
- $this->assertEquals($result, 'I am in default config!');
+ $this->assertEquals('I am in default config!', $result);
$result = Cache::read('value_one', 'test_name');
- $this->assertEquals($result, 'I am cached');
+ $this->assertEquals('I am cached', $result);
Cache::delete('value_one', 'test_name');
Cache::delete('value_one', 'default');
@@ -384,7 +384,7 @@ public function testSet() {
Cache::set(array('duration' => '+1 year'));
$data = Cache::read('test_cache');
- $this->assertEquals($data, 'this is just a simple test of the cache system');
+ $this->assertEquals('this is just a simple test of the cache system', $data);
Cache::delete('test_cache');
@@ -60,15 +60,15 @@ public function testReadAndWriteCache() {
$result = Cache::read('test', 'apc');
$expecting = '';
- $this->assertEquals($result, $expecting);
+ $this->assertEquals($expecting, $result);
$data = 'this is a test of the emergency broadcasting system';
$result = Cache::write('test', $data, 'apc');
$this->assertTrue($result);
$result = Cache::read('test', 'apc');
$expecting = $data;
- $this->assertEquals($result, $expecting);
+ $this->assertEquals($expecting, $result);
Cache::delete('test', 'apc');
}
@@ -62,11 +62,11 @@ public function tearDown() {
*/
public function testCacheDirChange() {
$result = Cache::config('sessions', array('engine' => 'File', 'path' => TMP . 'sessions'));
- $this->assertEquals($result['settings'], Cache::settings('sessions'));
+ $this->assertEquals(Cache::settings('sessions'), $result['settings']);
$result = Cache::config('sessions', array('engine' => 'File', 'path' => TMP . 'tests'));
- $this->assertEquals($result['settings'], Cache::settings('sessions'));
- $this->assertNotEquals($result['settings'], Cache::settings('default'));
+ $this->assertEquals(Cache::settings('sessions'), $result['settings']);
+ $this->assertNotEquals(Cache::settings('default'), $result['settings']);
}
/**
@@ -84,15 +84,15 @@ public function testReadAndWriteCache() {
$result = Cache::read('test', 'file_test');
$expecting = '';
- $this->assertEquals($result, $expecting);
+ $this->assertEquals($expecting, $result);
$data = 'this is a test of the emergency broadcasting system';
$result = Cache::write('test', $data, 'file_test');
$this->assertTrue(file_exists(CACHE . 'cake_test'));
$result = Cache::read('test', 'file_test');
$expecting = $data;
- $this->assertEquals($result, $expecting);
+ $this->assertEquals($expecting, $result);
Cache::delete('test', 'file_test');
}
@@ -243,11 +243,11 @@ public function testClearWithPrefixes() {
$FileOne->write('prefix_one_key_one', $data1, DAY);
$FileTwo->write('prefix_two_key_two', $data2, DAY);
- $this->assertEquals($FileOne->read('prefix_one_key_one'), $expected);
- $this->assertEquals($FileTwo->read('prefix_two_key_two'), $expected);
+ $this->assertEquals($expected, $FileOne->read('prefix_one_key_one'));
+ $this->assertEquals($expected, $FileTwo->read('prefix_two_key_two'));
$FileOne->clear(false);
- $this->assertEquals($FileTwo->read('prefix_two_key_two'), $expected, 'secondary config was cleared by accident.');
+ $this->assertEquals($expected, $FileTwo->read('prefix_two_key_two'), 'secondary config was cleared by accident.');
$FileTwo->clear(false);
}
@@ -262,7 +262,7 @@ public function testKeyPath() {
$this->assertTrue(file_exists(CACHE . 'cake_views_countries_something'));
$result = Cache::read('views.countries.something', 'file_test');
- $this->assertEquals($result, 'here');
+ $this->assertEquals('here', $result);
$result = Cache::clear(false, 'file_test');
$this->assertTrue($result);
@@ -91,7 +91,7 @@ public function testSettings() {
'engine' => 'Memcache',
'persistent' => true,
);
- $this->assertEquals($settings, $expecting);
+ $this->assertEquals($expecting, $settings);
}
/**
@@ -118,7 +118,7 @@ public function testMultipleServers() {
$servers = array_keys($Memcache->__Memcache->getExtendedStats());
$settings = $Memcache->settings();
- $this->assertEquals($servers, $settings['servers']);
+ $this->assertEquals($settings['servers'], $servers);
Cache::drop('dual_server');
}
@@ -160,10 +160,10 @@ public function testConnectIpv6() {
public function testParseServerStringNonLatin() {
$Memcache = new TestMemcacheEngine();
$result = $Memcache->parseServerString('schülervz.net:13211');
- $this->assertEquals($result, array('schülervz.net', '13211'));
+ $this->assertEquals(array('schülervz.net', '13211'), $result);
$result = $Memcache->parseServerString('sülül:1111');
- $this->assertEquals($result, array('sülül', '1111'));
+ $this->assertEquals(array('sülül', '1111'), $result);
}
/**
@@ -174,7 +174,7 @@ public function testParseServerStringNonLatin() {
public function testParseServerStringUnix() {
$Memcache = new TestMemcacheEngine();
$result = $Memcache->parseServerString('unix:///path/to/memcached.sock');
- $this->assertEquals($result, array('unix:///path/to/memcached.sock', 0));
+ $this->assertEquals(array('unix:///path/to/memcached.sock', 0), $result);
}
/**
@@ -187,15 +187,15 @@ public function testReadAndWriteCache() {
$result = Cache::read('test', 'memcache');
$expecting = '';
- $this->assertEquals($result, $expecting);
+ $this->assertEquals($expecting, $result);
$data = 'this is a test of the emergency broadcasting system';
$result = Cache::write('test', $data, 'memcache');
$this->assertTrue($result);
$result = Cache::read('test', 'memcache');
$expecting = $data;
- $this->assertEquals($result, $expecting);
+ $this->assertEquals($expecting, $result);
Cache::delete('test', 'memcache');
}
@@ -243,7 +243,7 @@ public function testExpiry() {
sleep(2);
$result = Cache::read('long_expiry_test', 'memcache');
$expecting = $data;
- $this->assertEquals($result, $expecting);
+ $this->assertEquals($expecting, $result);
Cache::config('memcache', array('duration' => 3600));
}
@@ -327,11 +327,11 @@ public function testConfigurationConflict() {
$this->assertTrue(Cache::write('duration_test', 'yay', 'long_memcache'));
$this->assertTrue(Cache::write('short_duration_test', 'boo', 'short_memcache'));
- $this->assertEquals(Cache::read('duration_test', 'long_memcache'), 'yay', 'Value was not read %s');
- $this->assertEquals(Cache::read('short_duration_test', 'short_memcache'), 'boo', 'Value was not read %s');
+ $this->assertEquals('yay', Cache::read('duration_test', 'long_memcache'), 'Value was not read %s');
+ $this->assertEquals('boo', Cache::read('short_duration_test', 'short_memcache'), 'Value was not read %s');
sleep(1);
- $this->assertEquals(Cache::read('duration_test', 'long_memcache'), 'yay', 'Value was not read %s');
+ $this->assertEquals('yay', Cache::read('duration_test', 'long_memcache'), 'Value was not read %s');
sleep(2);
$this->assertFalse(Cache::read('short_duration_test', 'short_memcache'), 'Cache was not invalidated %s');
@@ -376,9 +376,9 @@ public function testZeroDuration() {
Cache::config('memcache', array('duration' => 0));
$result = Cache::write('test_key', 'written!', 'memcache');
- $this->assertTrue($result, 'Could not write with duration 0');
+ $this->assertTrue('Could not write with duration 0', $result);
$result = Cache::read('test_key', 'memcache');
- $this->assertEquals($result, 'written!');
+ $this->assertEquals('written!', $result);
}
/**
@@ -59,15 +59,15 @@ public function testReadAndWriteCache() {
$result = Cache::read('test', 'wincache');
$expecting = '';
- $this->assertEquals($result, $expecting);
+ $this->assertEquals($expecting, $result);
$data = 'this is a test of the emergency broadcasting system';
$result = Cache::write('test', $data, 'wincache');
$this->assertTrue($result);
$result = Cache::read('test', 'wincache');
$expecting = $data;
- $this->assertEquals($result, $expecting);
+ $this->assertEquals($expecting, $result);
Cache::delete('test', 'wincache');
}
@@ -80,15 +80,15 @@ public function testReadAndWriteCache() {
$result = Cache::read('test');
$expecting = '';
- $this->assertEquals($result, $expecting);
+ $this->assertEquals($expecting, $result);
$data = 'this is a test of the emergency broadcasting system';
$result = Cache::write('test', $data);
$this->assertTrue($result);
$result = Cache::read('test');
$expecting = $data;
- $this->assertEquals($result, $expecting);
+ $this->assertEquals($expecting, $result);
Cache::delete('test');
}
@@ -77,7 +77,7 @@ public function testReadingWithoutSection() {
'some_key' => 'some_value',
'bool_key' => true
);
- $this->assertEquals($config, $expected);
+ $this->assertEquals($expected, $config);
}
/**
Oops, something went wrong.

0 comments on commit d748fc7

Please sign in to comment.