From 9844da8e9995ff3ae96a8c547c6c25788d82ac68 Mon Sep 17 00:00:00 2001 From: euromark Date: Wed, 25 Sep 2013 20:58:29 +0200 Subject: [PATCH 01/12] Don't use comp. wrappers anymore. --- lib/Cake/Test/Case/Model/CakeSchemaTest.php | 2 +- lib/Cake/Test/Case/Model/ModelCrossSchemaHabtmTest.php | 2 +- lib/Cake/Test/Case/View/Helper/FormHelperTest.php | 2 +- lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php | 2 +- lib/Cake/Test/Case/View/ViewTest.php | 2 +- lib/Cake/Test/Fixture/AssertTagsTestCase.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Cake/Test/Case/Model/CakeSchemaTest.php b/lib/Cake/Test/Case/Model/CakeSchemaTest.php index 07afe7fee..244568adc 100644 --- a/lib/Cake/Test/Case/Model/CakeSchemaTest.php +++ b/lib/Cake/Test/Case/Model/CakeSchemaTest.php @@ -703,7 +703,7 @@ class CakeSchemaTest extends CakeTestCase { ); $result = $this->Schema->generateTable('fields', $posts); $this->assertRegExp('/public \$fields/', $result); - $this->assertPattern('/\'type\' \=\> \'fulltext\'/', $result); + $this->assertRegExp('/\'type\' \=\> \'fulltext\'/', $result); } /** diff --git a/lib/Cake/Test/Case/Model/ModelCrossSchemaHabtmTest.php b/lib/Cake/Test/Case/Model/ModelCrossSchemaHabtmTest.php index bc06c1e65..4081d5ee2 100644 --- a/lib/Cake/Test/Case/Model/ModelCrossSchemaHabtmTest.php +++ b/lib/Cake/Test/Case/Model/ModelCrossSchemaHabtmTest.php @@ -147,7 +147,7 @@ class ModelCrossSchemaHabtmTest extends BaseModelTest { )); $results = $Player->saveAll($player, array('validate' => 'first')); - $this->assertNotEqual(false, $results); + $this->assertNotSame(false, $results); $count = $Player->find('count'); $this->assertEquals(5, $count); diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php index 97dd8a0ae..a87ed117f 100644 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -9312,7 +9312,7 @@ class FormHelperTest extends CakeTestCase { 'div' => false, 'label' => false, ); - $this->assertEqual($result, $expected); + $this->assertEquals($expected, $result); } } diff --git a/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php b/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php index 5e63a3fe5..d8f289d1f 100644 --- a/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php @@ -2233,7 +2233,7 @@ class PaginatorHelperTest extends CakeTestCase { */ public function testParam() { $result = $this->Paginator->param('count'); - $this->assertIdentical(62, $result); + $this->assertSame(62, $result); $result = $this->Paginator->param('imaginary'); $this->assertNull($result); diff --git a/lib/Cake/Test/Case/View/ViewTest.php b/lib/Cake/Test/Case/View/ViewTest.php index 45fff9196..337591e7e 100644 --- a/lib/Cake/Test/Case/View/ViewTest.php +++ b/lib/Cake/Test/Case/View/ViewTest.php @@ -1388,7 +1388,7 @@ class ViewTest extends CakeTestCase { public function testBlockSetDecimal() { $this->View->assign('testWithDecimal', 1.23456789); $result = $this->View->fetch('testWithDecimal'); - $this->assertEqual('1.23456789', $result); + $this->assertEquals('1.23456789', $result); } /** diff --git a/lib/Cake/Test/Fixture/AssertTagsTestCase.php b/lib/Cake/Test/Fixture/AssertTagsTestCase.php index 42bebde9a..9391dd426 100644 --- a/lib/Cake/Test/Fixture/AssertTagsTestCase.php +++ b/lib/Cake/Test/Fixture/AssertTagsTestCase.php @@ -1,6 +1,6 @@ Date: Wed, 25 Sep 2013 22:07:52 +0200 Subject: [PATCH 02/12] correct order of params --- lib/Cake/Test/Case/View/Helper/FormHelperTest.php | 6 +++--- lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php index a87ed117f..0959c9ce6 100644 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -6754,7 +6754,7 @@ class FormHelperTest extends CakeTestCase { $result = $matches[1]; $expected = range(date('Y') + 20, 1930); - $this->assertEquals($result, $expected); + $this->assertEquals($expected, $result); $this->Form->request->data['Project']['release'] = '2050-10-10'; $result = $this->Form->year('Project.release'); @@ -6762,7 +6762,7 @@ class FormHelperTest extends CakeTestCase { $result = $matches[1]; $expected = range(2050, date('Y') - 20); - $this->assertEquals($result, $expected); + $this->assertEquals($expected, $result); $this->Form->request->data['Project']['release'] = '1881-10-10'; $result = $this->Form->year('Project.release', 1890, 1900); @@ -6770,7 +6770,7 @@ class FormHelperTest extends CakeTestCase { $result = $matches[1]; $expected = range(1900, 1881); - $this->assertEquals($result, $expected); + $this->assertEquals($expected, $result); } /** diff --git a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php index 9b4ceb70c..d0957653f 100644 --- a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php @@ -1844,13 +1844,13 @@ class HtmlHelperTest extends CakeTestCase { $this->assertTags($result, array('div' => array('class' => 'class-name'), '<text>', '/div')); $result = $this->Html->tag(false, 'stuff'); - $this->assertEquals($result, 'stuff'); + $this->assertEquals('stuff', $result); $result = $this->Html->tag(null, 'stuff'); - $this->assertEquals($result, 'stuff'); + $this->assertEquals('stuff', $result); $result = $this->Html->tag('', 'stuff'); - $this->assertEquals($result, 'stuff'); + $this->assertEquals('stuff', $result); } /** From c23531e806b932181cf8fbaa737ecd1ae4ec14c8 Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 27 Sep 2013 12:53:18 +0200 Subject: [PATCH 03/12] Assert own tasks are loaded before trying to access taskNames. --- lib/Cake/Console/Shell.php | 1 + lib/Cake/Console/ShellDispatcher.php | 1 - lib/Cake/Test/Case/Console/ShellDispatcherTest.php | 4 ---- lib/Cake/Test/Case/Console/ShellTest.php | 2 ++ 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/Cake/Console/Shell.php b/lib/Cake/Console/Shell.php index 5f52ecd69..c9fe3cbb6 100644 --- a/lib/Cake/Console/Shell.php +++ b/lib/Cake/Console/Shell.php @@ -201,6 +201,7 @@ class Shell extends Object { */ public function initialize() { $this->_loadModels(); + $this->loadTasks(); } /** diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index ab1709131..157b2ab1d 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -206,7 +206,6 @@ class ShellDispatcher { if ($Shell instanceof Shell) { $Shell->initialize(); - $Shell->loadTasks(); return $Shell->runCommand($command, $this->args); } $methods = array_diff(get_class_methods($Shell), get_class_methods('Shell')); diff --git a/lib/Cake/Test/Case/Console/ShellDispatcherTest.php b/lib/Cake/Test/Case/Console/ShellDispatcherTest.php index 3d647be48..520ed6448 100644 --- a/lib/Cake/Test/Case/Console/ShellDispatcherTest.php +++ b/lib/Cake/Test/Case/Console/ShellDispatcherTest.php @@ -441,7 +441,6 @@ class ShellDispatcherTest extends CakeTestCase { $Mock = $this->getMock('Shell', array(), array(), 'MockWithMainShell'); $Mock->expects($this->once())->method('initialize'); - $Mock->expects($this->once())->method('loadTasks'); $Mock->expects($this->once())->method('runCommand') ->with(null, array()) ->will($this->returnValue(true)); @@ -467,7 +466,6 @@ class ShellDispatcherTest extends CakeTestCase { $this->mockObjects[] = $Shell; $Shell->expects($this->once())->method('initialize'); - $Shell->expects($this->once())->method('loadTasks'); $Shell->expects($this->once())->method('runCommand') ->with('initdb', array('initdb')) ->will($this->returnValue(true)); @@ -491,7 +489,6 @@ class ShellDispatcherTest extends CakeTestCase { $Shell = $this->getMock('Object', $methods, array(), 'MockWithMainNotAShell'); $Shell->expects($this->never())->method('initialize'); - $Shell->expects($this->never())->method('loadTasks'); $Shell->expects($this->once())->method('startup'); $Shell->expects($this->once())->method('main')->will($this->returnValue(true)); $Dispatcher->TestShell = $Shell; @@ -524,7 +521,6 @@ class ShellDispatcherTest extends CakeTestCase { $Shell = $this->getMock('Object', $methods, array(&$Dispatcher), 'MockWithoutMainNotAShell'); $Shell->expects($this->never())->method('initialize'); - $Shell->expects($this->never())->method('loadTasks'); $Shell->expects($this->once())->method('startup'); $Shell->expects($this->once())->method('main')->will($this->returnValue(true)); $Dispatcher->TestShell = $Shell; diff --git a/lib/Cake/Test/Case/Console/ShellTest.php b/lib/Cake/Test/Case/Console/ShellTest.php index 10e15be6a..cd10eb13d 100644 --- a/lib/Cake/Test/Case/Console/ShellTest.php +++ b/lib/Cake/Test/Case/Console/ShellTest.php @@ -195,6 +195,7 @@ class ShellTest extends CakeTestCase { ), App::RESET); CakePlugin::load('TestPlugin'); + $this->Shell->tasks = array('DbConfig' => array('one', 'two')); $this->Shell->uses = array('TestPlugin.TestPluginPost'); $this->Shell->initialize(); @@ -208,6 +209,7 @@ class ShellTest extends CakeTestCase { $this->assertTrue(isset($this->Shell->Comment)); $this->assertInstanceOf('Comment', $this->Shell->Comment); $this->assertEquals('Comment', $this->Shell->modelClass); + $this->assertInstanceOf('DbConfigTask', $this->Shell->DbConfig); App::build(); } From 56f1c9b8b5e599c3a446a7bdad2e166e0f319c4b Mon Sep 17 00:00:00 2001 From: Andy Hobbs Date: Fri, 27 Sep 2013 13:03:32 +0100 Subject: [PATCH 04/12] Ticket 4108 - updated DboSourceTest::testFieldsCacheKeyWithSchemanameChange() to skip for Postgres and Sqlserver --- lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php index bcfd5a060..7fc9a80cc 100644 --- a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php @@ -951,6 +951,9 @@ class DboSourceTest extends CakeTestCase { * @return void */ public function testFieldsCacheKeyWithSchemanameChange() { + if ($this->db instanceof Postgres || $this->db instanceof Sqlserver) { + $this->markTestSkipped('Cannot run this test with SqlServer or Postgres'); + } Cache::delete('method_cache', '_cake_core_'); DboSource::$methodCache = array(); $Article = ClassRegistry::init('Article'); From 2a954b6095ff680d3b7672339166492e0e03ceb3 Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 27 Sep 2013 14:48:57 +0200 Subject: [PATCH 05/12] Make TextHelper::autoLink() work properly with umlauts. --- .../Test/Case/View/Helper/TextHelperTest.php | 16 ++++++++++++---- lib/Cake/View/Helper/TextHelper.php | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php index 887f84372..1bb27f465 100644 --- a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php @@ -241,6 +241,14 @@ class TextHelperTest extends CakeTestCase { 'Text with a url http://www.not--work.com and more', 'Text with a url http://www.not--work.com and more', ), + array( + 'Text with a partial www.küchenschöhn-not-working.de URL', + 'Text with a partial www.küchenschöhn-not-working.de URL' + ), + array( + 'Text with a partial http://www.küchenschöhn-not-working.de URL', + 'Text with a partial http://www.küchenschöhn-not-working.de URL' + ) ); } @@ -383,7 +391,7 @@ TEXT; TEXT; $result = $this->Text->autoParagraph($text); - $this->assertEquals($expected, $result); + $this->assertTextEquals($expected, $result); $result = $this->Text->autoParagraph($text); $text = 'This is a

test text'; $expected = <<Text->autoParagraph($text); - $this->assertEquals($expected, $result); + $this->assertTextEquals($expected, $result); $text = << TEXT; $result = $this->Text->autoParagraph($text); - $this->assertEquals($expected, $result); + $this->assertTextEquals($expected, $result); $text = <<Text->autoParagraph($text); - $this->assertEquals($expected, $result); + $this->assertTextEquals($expected, $result); } } diff --git a/lib/Cake/View/Helper/TextHelper.php b/lib/Cake/View/Helper/TextHelper.php index 379c89582..96d6d7098 100644 --- a/lib/Cake/View/Helper/TextHelper.php +++ b/lib/Cake/View/Helper/TextHelper.php @@ -105,7 +105,7 @@ class TextHelper extends AppHelper { $this->_placeholders = array(); $options += array('escape' => true); - $pattern = '#(?)((?:https?|ftp|nntp)://[a-z0-9.\-:]+(?:[/?][^\s<]*)?)#i'; + $pattern = '#(?)((?:https?|ftp|nntp)://[\p{L}0-9.\-:]+(?:[/?][^\s<]*)?)#ui'; $text = preg_replace_callback( $pattern, array(&$this, '_insertPlaceHolder'), From 205f7a504bc73dc86fcaa5a593d7b6a426112223 Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 27 Sep 2013 14:56:53 +0200 Subject: [PATCH 06/12] also fix autoLinkEmail() --- lib/Cake/Test/Case/View/Helper/TextHelperTest.php | 5 +++++ lib/Cake/View/Helper/TextHelper.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php index 1bb27f465..e620c13b9 100644 --- a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php @@ -359,6 +359,11 @@ class TextHelperTest extends CakeTestCase { $expected = 'Text with email@example.com address'; $result = $this->Text->autoLinkEmails($text, array('class' => 'link')); $this->assertRegExp('#^' . $expected . '$#', $result); + + $text = 'Text with düsentrieb@küchenschöhn-not-working.de address'; + $expected = 'Text with düsentrieb@küchenschöhn-not-working.de address'; + $result = $this->Text->autoLinkEmails($text); + $this->assertRegExp('#^' . $expected . '$#', $result); } /** diff --git a/lib/Cake/View/Helper/TextHelper.php b/lib/Cake/View/Helper/TextHelper.php index 96d6d7098..b979ec617 100644 --- a/lib/Cake/View/Helper/TextHelper.php +++ b/lib/Cake/View/Helper/TextHelper.php @@ -186,9 +186,9 @@ class TextHelper extends AppHelper { $options += array('escape' => true); $this->_placeholders = array(); - $atom = '[a-z0-9!#$%&\'*+\/=?^_`{|}~-]'; + $atom = '[\p{L}0-9!#$%&\'*+\/=?^_`{|}~-]'; $text = preg_replace_callback( - '/(' . $atom . '+(?:\.' . $atom . '+)*@[a-z0-9-]+(?:\.[a-z0-9-]+)+)/i', + '/(' . $atom . '+(?:\.' . $atom . '+)*@[\p{L}0-9-]+(?:\.[a-z0-9-]+)+)/ui', array(&$this, '_insertPlaceholder'), $text ); From bd87ef45f2b36e35e806082623792d91b30ca639 Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 27 Sep 2013 15:01:46 +0200 Subject: [PATCH 07/12] complete autoLinkEmail() --- lib/Cake/Test/Case/View/Helper/TextHelperTest.php | 5 +++++ lib/Cake/View/Helper/TextHelper.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php index e620c13b9..2fc6f21ab 100644 --- a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php @@ -364,6 +364,11 @@ class TextHelperTest extends CakeTestCase { $expected = 'Text with düsentrieb@küchenschöhn-not-working.de address'; $result = $this->Text->autoLinkEmails($text); $this->assertRegExp('#^' . $expected . '$#', $result); + + $text = 'Text with me@subdomain.küchenschöhn.de address'; + $expected = 'Text with me@subdomain.küchenschöhn.de address'; + $result = $this->Text->autoLinkEmails($text); + $this->assertRegExp('#^' . $expected . '$#', $result); } /** diff --git a/lib/Cake/View/Helper/TextHelper.php b/lib/Cake/View/Helper/TextHelper.php index b979ec617..ffa89b543 100644 --- a/lib/Cake/View/Helper/TextHelper.php +++ b/lib/Cake/View/Helper/TextHelper.php @@ -188,7 +188,7 @@ class TextHelper extends AppHelper { $atom = '[\p{L}0-9!#$%&\'*+\/=?^_`{|}~-]'; $text = preg_replace_callback( - '/(' . $atom . '+(?:\.' . $atom . '+)*@[\p{L}0-9-]+(?:\.[a-z0-9-]+)+)/ui', + '/(' . $atom . '+(?:\.' . $atom . '+)*@[\p{L}0-9-]+(?:\.[\p{L}0-9-]+)+)/ui', array(&$this, '_insertPlaceholder'), $text ); From 4dbf9107a89ce56180eb1226d2696e1aaa23ac30 Mon Sep 17 00:00:00 2001 From: ADmad Date: Tue, 24 Sep 2013 13:46:31 +0530 Subject: [PATCH 08/12] Fixed infinite redirects for authenticated users accessing login page. --- .../Controller/Component/AuthComponent.php | 24 +++++++++---------- .../Component/AuthComponentTest.php | 22 +++++++++++++++++ 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index fe1f1e8af..2a0097921 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -304,7 +304,10 @@ class AuthComponent extends Component { return $this->_unauthenticated($controller); } - if (empty($this->authorize) || $this->isAuthorized($this->user())) { + if ($this->_isLoginAction($controller) || + empty($this->authorize) || + $this->isAuthorized($this->user()) + ) { return true; } @@ -347,6 +350,11 @@ class AuthComponent extends Component { } if ($this->_isLoginAction($controller)) { + if (empty($controller->request->data)) { + if (!$this->Session->check('Auth.redirect') && env('HTTP_REFERER')) { + $this->Session->write('Auth.redirect', $controller->referer(null, true)); + } + } return true; } @@ -367,9 +375,7 @@ class AuthComponent extends Component { } /** - * Normalizes $loginAction and checks if current request url is same as login - * action. If current url is same as login action, referrer url is saved in session - * which is later accessible using redirectUrl(). + * Normalizes $loginAction and checks if current request url is same as login action. * * @param Controller $controller A reference to the controller object. * @return boolean True if current action is login action else false. @@ -382,15 +388,7 @@ class AuthComponent extends Component { $url = Router::normalize($url); $loginAction = Router::normalize($this->loginAction); - if ($loginAction == $url) { - if (empty($controller->request->data)) { - if (!$this->Session->check('Auth.redirect') && env('HTTP_REFERER')) { - $this->Session->write('Auth.redirect', $controller->referer(null, true)); - } - } - return true; - } - return false; + return $loginAction === $url; } /** diff --git a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php index 1fcf626bb..89826f5a2 100644 --- a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php @@ -876,6 +876,28 @@ class AuthComponentTest extends CakeTestCase { $this->Auth->Session->delete('Auth'); } +/** + * testNoLoginRedirectForAuthenticatedUser method + * + * @return void + */ + public function testNoLoginRedirectForAuthenticatedUser() { + $this->Controller->request['controller'] = 'auth_test'; + $this->Controller->request['action'] = 'login'; + $this->Controller->here = '/auth_test/login'; + $this->Auth->request->url = 'auth_test/login'; + + $this->Auth->Session->write('Auth.User.id', '1'); + $this->Auth->authenticate = array('Form'); + $this->getMock('BaseAuthorize', array('authorize'), array(), 'NoLoginRedirectMockAuthorize', false); + $this->Auth->authorize = array('NoLoginRedirectMockAuthorize'); + $this->Auth->loginAction = array('controller' => 'auth_test', 'action' => 'login'); + + $return = $this->Auth->startup($this->Controller); + $this->assertTrue($return); + $this->assertNull($this->Controller->testUrl); + } + /** * Default to loginRedirect, if set, on authError. * From df269ba0ef0b14f3fd392ad7858fe72d25f2109f Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 27 Sep 2013 19:36:43 +0200 Subject: [PATCH 09/12] Cake to CakePHP name --- README.md | 2 +- index.php | 2 +- lib/Cake/Controller/Controller.php | 2 +- lib/Cake/Routing/Dispatcher.php | 2 +- lib/Cake/TestSuite/CakeTestLoader.php | 2 +- lib/Cake/TestSuite/CakeTestRunner.php | 4 ++-- lib/Cake/TestSuite/Fixture/CakeTestFixture.php | 2 +- lib/Cake/Utility/Inflector.php | 2 +- lib/Cake/View/View.php | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e38062eef..7f178f870 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Some Handy Links [The Bakery](http://bakery.cakephp.org) - Tips, tutorials and articles -[API](http://api.cakephp.org) - A reference to Cake's classes +[API](http://api.cakephp.org) - A reference to CakePHP's classes [CakePHP TV](http://tv.cakephp.org) - Screen casts from events and video tutorials diff --git a/index.php b/index.php index 94747188f..95f389bcc 100644 --- a/index.php +++ b/index.php @@ -23,7 +23,7 @@ */ /** - * Get Cake's root directory + * Get CakePHP's root directory */ define('APP_DIR', 'app'); define('DS', DIRECTORY_SEPARATOR); diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index b3982bfe4..0f36fb7f5 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -207,7 +207,7 @@ class Controller extends Object implements CakeEventListener { public $View; /** - * File extension for view templates. Defaults to Cake's conventional ".ctp". + * File extension for view templates. Defaults to CakePHP's conventional ".ctp". * * @var string */ diff --git a/lib/Cake/Routing/Dispatcher.php b/lib/Cake/Routing/Dispatcher.php index aed253a88..2ad4efa53 100644 --- a/lib/Cake/Routing/Dispatcher.php +++ b/lib/Cake/Routing/Dispatcher.php @@ -3,7 +3,7 @@ * Dispatcher takes the URL information, parses it for parameters and * tells the involved controllers what to do. * - * This is the heart of Cake's operation. + * This is the heart of CakePHP's operation. * * PHP 5 * diff --git a/lib/Cake/TestSuite/CakeTestLoader.php b/lib/Cake/TestSuite/CakeTestLoader.php index fe2e324f6..431ae0ad3 100644 --- a/lib/Cake/TestSuite/CakeTestLoader.php +++ b/lib/Cake/TestSuite/CakeTestLoader.php @@ -42,7 +42,7 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader { } /** - * Convert path fragments used by Cake's test runner to absolute paths that can be fed to PHPUnit. + * Convert path fragments used by CakePHP's test runner to absolute paths that can be fed to PHPUnit. * * @param string $filePath * @param string $params diff --git a/lib/Cake/TestSuite/CakeTestRunner.php b/lib/Cake/TestSuite/CakeTestRunner.php index 535f70a8d..fe64e30fe 100644 --- a/lib/Cake/TestSuite/CakeTestRunner.php +++ b/lib/Cake/TestSuite/CakeTestRunner.php @@ -22,14 +22,14 @@ require_once 'PHPUnit/TextUI/TestRunner.php'; App::uses('CakeFixtureManager', 'TestSuite/Fixture'); /** - * A custom test runner for Cake's use of PHPUnit. + * A custom test runner for CakePHP's use of PHPUnit. * * @package Cake.TestSuite */ class CakeTestRunner extends PHPUnit_TextUI_TestRunner { /** - * Lets us pass in some options needed for cake's webrunner. + * Lets us pass in some options needed for CakePHP's webrunner. * * @param mixed $loader * @param array $params list of options to be used for this run diff --git a/lib/Cake/TestSuite/Fixture/CakeTestFixture.php b/lib/Cake/TestSuite/Fixture/CakeTestFixture.php index 3fbd2ddc3..546092e4a 100644 --- a/lib/Cake/TestSuite/Fixture/CakeTestFixture.php +++ b/lib/Cake/TestSuite/Fixture/CakeTestFixture.php @@ -32,7 +32,7 @@ class CakeTestFixture { public $name = null; /** - * Cake's DBO driver (e.g: DboMysql). + * CakePHP's DBO driver (e.g: DboMysql). * * @var object */ diff --git a/lib/Cake/Utility/Inflector.php b/lib/Cake/Utility/Inflector.php index 11bafbf9c..394b75257 100644 --- a/lib/Cake/Utility/Inflector.php +++ b/lib/Cake/Utility/Inflector.php @@ -18,7 +18,7 @@ * Pluralize and singularize English words. * * Inflector pluralizes and singularizes English nouns. - * Used by Cake's naming conventions throughout the framework. + * Used by CakePHP's naming conventions throughout the framework. * * @package Cake.Utility * @link http://book.cakephp.org/2.0/en/core-utility-libraries/inflector.html diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index 74ece6707..78a042b69 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -136,7 +136,7 @@ class View extends Object { public $layoutPath = null; /** - * Turns on or off Cake's conventional mode of applying layout files. On by default. + * Turns on or off CakePHP's conventional mode of applying layout files. On by default. * Setting to off means that layouts will not be automatically applied to rendered views. * * @var boolean @@ -144,7 +144,7 @@ class View extends Object { public $autoLayout = true; /** - * File extension. Defaults to Cake's template ".ctp". + * File extension. Defaults to CakePHP's template ".ctp". * * @var string */ From 9a86f7e8832aa0954458d9038a9c1343c2cd3e30 Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 27 Sep 2013 20:28:03 +0200 Subject: [PATCH 10/12] correct spelling mistake --- lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php b/lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php index 57a390069..dc0e44b6e 100644 --- a/lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php +++ b/lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php @@ -3477,7 +3477,7 @@ class ContainableBehaviorTest extends CakeTestCase { 'joinTable' => 'articles_tags', 'foreignKey' => 'article_id', 'associationForeignKey' => 'tag_id', - // LENGHT function mysql-only, using LIKE does almost the same + // LENGTH function mysql-only, using LIKE does almost the same 'conditions' => "ShortTag.tag LIKE '???'" ) ) From bb65765d70187205d7d89979d1a2a139e9e52c0b Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Fri, 27 Sep 2013 21:31:35 -0400 Subject: [PATCH 11/12] Updated additional references of Cake to CakePHP --- app/Config/database.php.default | 2 +- app/Config/email.php.default | 2 +- app/Model/AppModel.php | 2 +- lib/Cake/Console/ShellDispatcher.php | 2 +- lib/Cake/Model/Datasource/CakeSession.php | 10 +++++----- lib/Cake/Utility/Xml.php | 2 +- lib/Cake/bootstrap.php | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/Config/database.php.default b/app/Config/database.php.default index 684fecdf9..47613acf1 100644 --- a/app/Config/database.php.default +++ b/app/Config/database.php.default @@ -2,7 +2,7 @@ /** * This is core configuration file. * - * Use it to configure core behaviour of Cake. + * Use it to configure core behaviour of CakePHP. * * PHP 5 * diff --git a/app/Config/email.php.default b/app/Config/email.php.default index a2d355e47..717a45860 100644 --- a/app/Config/email.php.default +++ b/app/Config/email.php.default @@ -2,7 +2,7 @@ /** * This is email configuration file. * - * Use it to configure email transports of Cake. + * Use it to configure email transports of CakePHP. * * PHP 5 * diff --git a/app/Model/AppModel.php b/app/Model/AppModel.php index c47d72922..5b79d2a04 100644 --- a/app/Model/AppModel.php +++ b/app/Model/AppModel.php @@ -1,6 +1,6 @@ Date: Fri, 27 Sep 2013 22:22:23 -0400 Subject: [PATCH 12/12] Rename config class used in test cases. Having a separate classname for testing allows the testsuite to not provide a classname that the application would. This allows composer to generate the correct classmap when CakePHP is installed with composer. Fixes #4112 --- lib/Cake/Network/Email/CakeEmail.php | 11 +++++++++-- .../Test/Case/Network/Email/CakeEmailTest.php | 17 +++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/lib/Cake/Network/Email/CakeEmail.php b/lib/Cake/Network/Email/CakeEmail.php index f0da7182f..959017556 100644 --- a/lib/Cake/Network/Email/CakeEmail.php +++ b/lib/Cake/Network/Email/CakeEmail.php @@ -325,6 +325,13 @@ class CakeEmail { */ protected $_emailPattern = null; +/** + * The classname used for email configuration. + * + * @var string + */ + protected $_configClass = 'EmailConfig'; + /** * Constructor * @@ -1179,10 +1186,10 @@ class CakeEmail { */ protected function _applyConfig($config) { if (is_string($config)) { - if (!class_exists('EmailConfig') && !config('email')) { + if (!class_exists($this->_configClass) && !config('email')) { throw new ConfigureException(__d('cake_dev', '%s not found.', APP . 'Config' . DS . 'email.php')); } - $configs = new EmailConfig(); + $configs = new $this->_configClass(); if (!isset($configs->{$config})) { throw new ConfigureException(__d('cake_dev', 'Unknown email configuration "%s".', $config)); } diff --git a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php index 025d96530..9fbb8c207 100644 --- a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php +++ b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php @@ -26,6 +26,15 @@ App::uses('CakeEmail', 'Network/Email'); */ class TestCakeEmail extends CakeEmail { +/** + * Config classname. + * + * Use a the testing config class in this file. + * + * @var string + */ + protected $_configClass = 'TestEmailConfig'; + /** * Config * @@ -79,7 +88,7 @@ class TestCakeEmail extends CakeEmail { * EmailConfig class * */ -class EmailConfig { +class TestEmailConfig { /** * test config @@ -841,7 +850,7 @@ class CakeEmailTest extends CakeTestCase { * @return void */ public function testConfigString() { - $configs = new EmailConfig(); + $configs = new TestEmailConfig(); $this->CakeEmail->config('test'); $result = $this->CakeEmail->to(); @@ -1767,8 +1776,8 @@ class CakeEmailTest extends CakeTestCase { * @return void */ public function testConstructWithConfigString() { - $configs = new EmailConfig(); - $this->CakeEmail = new CakeEmail('test'); + $configs = new TestEmailConfig(); + $this->CakeEmail = new TestCakeEmail('test'); $result = $this->CakeEmail->to(); $this->assertEquals($configs->test['to'], $result);