From 1ede742d926e3b8a060fcfb1a6dda2eb3e5c10c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Fri, 25 Sep 2015 17:22:00 +0200 Subject: [PATCH 1/3] Various improvements to the CakePHP test files Mostly CS, doc blocks and unused variables. --- .../Case/Console/ConsoleOptionParserTest.php | 10 +++++----- .../Controller/Component/Acl/DbAclTest.php | 1 - .../Auth/ControllerAuthorizeTest.php | 4 ++++ .../Component/AuthComponentTest.php | 3 +-- .../Component/PaginatorComponentTest.php | 4 ++-- .../Test/Case/Controller/ControllerTest.php | 2 +- lib/Cake/Test/Case/Core/CakePluginTest.php | 1 - lib/Cake/Test/Case/Core/ConfigureTest.php | 3 +++ lib/Cake/Test/Case/Core/ObjectTest.php | 9 +++++---- .../Test/Case/Event/CakeEventManagerTest.php | 1 - lib/Cake/Test/Case/Event/CakeEventTest.php | 1 - lib/Cake/Test/Case/Model/AclNodeTest.php | 3 +-- lib/Cake/Test/Case/Model/models.php | 1 - .../Test/Case/Network/CakeRequestTest.php | 8 +------- .../Test/Case/Network/CakeResponseTest.php | 8 ++++---- .../Test/Case/Network/Email/CakeEmailTest.php | 13 ++++-------- .../Case/Network/Email/DebugTransportTest.php | 1 - .../Case/Network/Email/MailTransportTest.php | 1 - .../Case/Network/Email/SmtpTransportTest.php | 10 ++++------ .../Test/Case/Network/Http/HttpSocketTest.php | 14 ++++++------- .../Routing/Filter/AssetDispatcherTest.php | 1 - .../Case/Routing/Route/RedirectRouteTest.php | 20 +++++++++---------- lib/Cake/Test/Case/Routing/RouterTest.php | 6 +++--- .../Test/Case/TestSuite/CakeTestCaseTest.php | 14 ++++++------- .../Case/TestSuite/CakeTestFixtureTest.php | 2 +- .../Case/TestSuite/ControllerTestCaseTest.php | 8 ++++---- lib/Cake/Test/Case/Utility/FolderTest.php | 2 +- .../Case/Utility/ObjectCollectionTest.php | 4 ++-- lib/Cake/Test/Case/Utility/SanitizeTest.php | 2 +- lib/Cake/Test/Case/Utility/SecurityTest.php | 2 +- lib/Cake/Test/Case/Utility/SetTest.php | 1 - lib/Cake/Test/Case/Utility/ValidationTest.php | 2 +- lib/Cake/Test/Case/Utility/XmlTest.php | 6 +++--- .../Test/bake_compare/Controller/Scaffold.ctp | 1 - .../Datasource/Session/TestAppLibSession.php | 1 - .../TestPlugin/View/Errors/error500.ctp | 1 - .../Test/test_app/View/Elements/html_call.ctp | 3 +-- .../test_app/View/Emails/html/default.ctp | 3 +-- lib/Cake/Test/test_app/View/Layouts/ajax2.ctp | 3 ++- .../test_app/View/Layouts/rss/default.ctp | 4 +--- .../test_app/View/Posts/helper_overwrite.ctp | 3 +-- .../Test/test_app/View/Posts/parent_view.ctp | 2 +- .../test_app/View/Posts/test_nocache_tags.ctp | 2 +- .../Themed/TestTheme/Emails/text/themed.ctp | 2 +- .../View/Themed/TestTheme/Layouts/default.ctp | 2 +- lib/Cake/TestSuite/CakeTestCase.php | 4 ++-- lib/Cake/TestSuite/CakeTestLoader.php | 6 +++--- lib/Cake/TestSuite/ControllerTestCase.php | 2 +- .../TestSuite/Reporter/CakeHtmlReporter.php | 4 ++-- lib/Cake/TestSuite/templates/header.php | 2 +- 50 files changed, 94 insertions(+), 119 deletions(-) diff --git a/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php b/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php index 0b68f999a..5a194db08 100644 --- a/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php +++ b/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php @@ -37,7 +37,7 @@ class ConsoleOptionParserTest extends CakeTestCase { $this->assertEquals($parser, $result, 'Setting description is not chainable'); $this->assertEquals('A test', $parser->description(), 'getting value is wrong.'); - $result = $parser->description(array('A test', 'something')); + $parser->description(array('A test', 'something')); $this->assertEquals("A test\nsomething", $parser->description(), 'getting value is wrong.'); } @@ -53,7 +53,7 @@ class ConsoleOptionParserTest extends CakeTestCase { $this->assertEquals($parser, $result, 'Setting epilog is not chainable'); $this->assertEquals('A test', $parser->epilog(), 'getting value is wrong.'); - $result = $parser->epilog(array('A test', 'something')); + $parser->epilog(array('A test', 'something')); $this->assertEquals("A test\nsomething", $parser->epilog(), 'getting value is wrong.'); } @@ -294,7 +294,7 @@ class ConsoleOptionParserTest extends CakeTestCase { $expected = array('name' => 'mark', 'help' => false); $this->assertEquals($expected, $result[0], 'Got the correct value.'); - $result = $parser->parse(array('--name', 'jimmy')); + $parser->parse(array('--name', 'jimmy')); } /** @@ -384,7 +384,7 @@ class ConsoleOptionParserTest extends CakeTestCase { $result = $parser->parse($expected); $this->assertEquals($expected, $result[1], 'Arguments are not as expected'); - $result = $parser->parse(array('one', 'two', 'three')); + $parser->parse(array('one', 'two', 'three')); } /** @@ -430,7 +430,7 @@ class ConsoleOptionParserTest extends CakeTestCase { $expected = array('mark', 'samurai', 'sword'); $this->assertEquals($expected, $result[1], 'Got the correct value.'); - $result = $parser->parse(array('jose', 'coder')); + $parser->parse(array('jose', 'coder')); } /** diff --git a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php index d4f2b6347..b1f927a58 100644 --- a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php @@ -155,7 +155,6 @@ class DbAclTwoTest extends DbAcl { /** * construct method - * */ public function __construct() { $this->Aro = new AroTwoTest(); diff --git a/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php b/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php index 8c57c6e76..80bb5c258 100644 --- a/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php @@ -45,6 +45,8 @@ class ControllerAuthorizeTest extends CakeTestCase { } /** + * testControllerTypeError + * * @expectedException PHPUnit_Framework_Error * @return void */ @@ -53,6 +55,8 @@ class ControllerAuthorizeTest extends CakeTestCase { } /** + * testControllerErrorOnMissingMethod + * * @expectedException CakeException * @return void */ diff --git a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php index b66252f24..8faae470a 100644 --- a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php @@ -176,7 +176,6 @@ class AuthTestController extends Controller { /** * construct method - * */ public function __construct($request, $response) { $request->addParams(Router::parse('/auth_test')); @@ -1319,7 +1318,7 @@ class AuthComponentTest extends CakeTestCase { ->with('HTTP/1.1 403 Forbidden', null); $this->Auth->initialize($this->Controller); - $result = $this->Auth->startup($this->Controller); + $this->Auth->startup($this->Controller); $this->assertArrayNotHasKey('Location', $this->Controller->response->header()); $this->assertNull($this->Controller->testUrl, 'redirect() not called'); diff --git a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php index 234d2dac3..fbcccc266 100644 --- a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php @@ -486,7 +486,7 @@ class PaginatorComponentTest extends CakeTestCase { $Controller->request->params['named'] = array('limit' => 12); $Controller->Paginator->settings = array('limit' => 30, 'maxLimit' => 100, 'paramType' => 'named'); - $result = $Controller->Paginator->paginate('PaginatorControllerPost'); + $Controller->Paginator->paginate('PaginatorControllerPost'); $paging = $Controller->params['paging']['PaginatorControllerPost']; $this->assertEquals(12, $Controller->PaginatorControllerPost->lastQueries[0]['limit']); @@ -504,7 +504,7 @@ class PaginatorComponentTest extends CakeTestCase { 'paramType' => 'named' ) ); - $result = $Controller->Paginator->paginate('ControllerPaginateModel'); + $Controller->Paginator->paginate('ControllerPaginateModel'); $expected = array( 'contain' => array('ControllerPaginateModel'), 'group' => 'Comment.author_id', diff --git a/lib/Cake/Test/Case/Controller/ControllerTest.php b/lib/Cake/Test/Case/Controller/ControllerTest.php index f319bd167..a8abc2bdd 100644 --- a/lib/Cake/Test/Case/Controller/ControllerTest.php +++ b/lib/Cake/Test/Case/Controller/ControllerTest.php @@ -653,7 +653,7 @@ class ControllerTest extends CakeTestCase { $expected = $Controller->ControllerComment->validationErrors; $Controller->viewPath = 'Posts'; - $result = $Controller->render('index'); + $Controller->render('index'); $View = $Controller->View; $this->assertTrue(isset($View->validationErrors['ControllerComment'])); $this->assertEquals($expected, $View->validationErrors['ControllerComment']); diff --git a/lib/Cake/Test/Case/Core/CakePluginTest.php b/lib/Cake/Test/Case/Core/CakePluginTest.php index 94bc3c5ac..3398d1661 100644 --- a/lib/Cake/Test/Case/Core/CakePluginTest.php +++ b/lib/Cake/Test/Case/Core/CakePluginTest.php @@ -20,7 +20,6 @@ App::uses('CakePlugin', 'Core'); /** * CakePluginTest class - * */ class CakePluginTest extends CakeTestCase { diff --git a/lib/Cake/Test/Case/Core/ConfigureTest.php b/lib/Cake/Test/Case/Core/ConfigureTest.php index a0c321e1a..744932dac 100644 --- a/lib/Cake/Test/Case/Core/ConfigureTest.php +++ b/lib/Cake/Test/Case/Core/ConfigureTest.php @@ -69,6 +69,7 @@ class ConfigureTest extends CakeTestCase { /** * Test to ensure bootrapping doesn't overwrite prior configs set under 'App' key + * * @return void */ public function testBootstrap() { @@ -469,6 +470,8 @@ class ConfigureTest extends CakeTestCase { } /** + * testDumpNoAdapter + * * @expectedException ConfigureException * @return void */ diff --git a/lib/Cake/Test/Case/Core/ObjectTest.php b/lib/Cake/Test/Case/Core/ObjectTest.php index c44291a3f..1556baa89 100644 --- a/lib/Cake/Test/Case/Core/ObjectTest.php +++ b/lib/Cake/Test/Case/Core/ObjectTest.php @@ -73,7 +73,7 @@ class RequestActionController extends Controller { /** * normal_request_action method * - * @return void + * @return string Hello World! */ public function normal_request_action() { return 'Hello World'; @@ -82,7 +82,7 @@ class RequestActionController extends Controller { /** * returns $this->here * - * @return void + * @return string $this->here. */ public function return_here() { return $this->here; @@ -91,7 +91,7 @@ class RequestActionController extends Controller { /** * paginate_request_action method * - * @return void + * @return true */ public function paginate_request_action() { $this->paginate(); @@ -251,8 +251,9 @@ class TestObject extends Object { } /** - * undocumented function + * Set properties. * + * @param array $properties The $properties. * @return void */ public function set($properties = array()) { diff --git a/lib/Cake/Test/Case/Event/CakeEventManagerTest.php b/lib/Cake/Test/Case/Event/CakeEventManagerTest.php index 5eb8d3a2c..db16e6b7f 100644 --- a/lib/Cake/Test/Case/Event/CakeEventManagerTest.php +++ b/lib/Cake/Test/Case/Event/CakeEventManagerTest.php @@ -88,7 +88,6 @@ class CustomTestEventListener extends CakeEventTestListener implements CakeEvent /** * Tests the CakeEventManager class functionality - * */ class CakeEventManagerTest extends CakeTestCase { diff --git a/lib/Cake/Test/Case/Event/CakeEventTest.php b/lib/Cake/Test/Case/Event/CakeEventTest.php index 9ba28d3a9..3bb4771f9 100644 --- a/lib/Cake/Test/Case/Event/CakeEventTest.php +++ b/lib/Cake/Test/Case/Event/CakeEventTest.php @@ -22,7 +22,6 @@ App::uses('CakeEvent', 'Event'); /** * Tests the CakeEvent class functionality - * */ class CakeEventTest extends CakeTestCase { diff --git a/lib/Cake/Test/Case/Model/AclNodeTest.php b/lib/Cake/Test/Case/Model/AclNodeTest.php index 391ccd79b..ca40243e6 100644 --- a/lib/Cake/Test/Case/Model/AclNodeTest.php +++ b/lib/Cake/Test/Case/Model/AclNodeTest.php @@ -181,8 +181,7 @@ class DbAroUserTest extends CakeTestModel { class TestDbAcl extends DbAcl { /** - * construct method - * + * Constructor */ public function __construct() { $this->Aro = new DbAroTest(); diff --git a/lib/Cake/Test/Case/Model/models.php b/lib/Cake/Test/Case/Model/models.php index 33a0cda21..ea8d36426 100644 --- a/lib/Cake/Test/Case/Model/models.php +++ b/lib/Cake/Test/Case/Model/models.php @@ -4781,7 +4781,6 @@ class MysqlTestModel extends Model { /** * Test model for datasource prefixes - * */ class PrefixTestModel extends CakeTestModel { } diff --git a/lib/Cake/Test/Case/Network/CakeRequestTest.php b/lib/Cake/Test/Case/Network/CakeRequestTest.php index 2dfdfea4e..b588565a5 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -318,12 +318,6 @@ class CakeRequestTest extends CakeTestCase { $request->reConstruct(); $this->assertEquals($data, $request->data); - $data = array( - 'data' => array( - 'Article' => array('title' => 'Testing'), - ), - 'action' => 'update' - ); $request = $this->getMock('TestCakeRequest', array('_readInput')); $request->expects($this->at(0))->method('_readInput') ->will($this->returnValue('data[Article][title]=Testing&action=update')); @@ -2261,7 +2255,7 @@ class CakeRequestTest extends CakeTestCase { // Checking if requested $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'es_mx,en_ca'; - $result = CakeRequest::acceptLanguage(); + CakeRequest::acceptLanguage(); $result = CakeRequest::acceptLanguage('en-ca'); $this->assertTrue($result); diff --git a/lib/Cake/Test/Case/Network/CakeResponseTest.php b/lib/Cake/Test/Case/Network/CakeResponseTest.php index 6abe8c97b..cbbe1c7c6 100644 --- a/lib/Cake/Test/Case/Network/CakeResponseTest.php +++ b/lib/Cake/Test/Case/Network/CakeResponseTest.php @@ -566,7 +566,7 @@ class CakeResponseTest extends CakeTestCase { $response->send(); ob_start(); - $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); + $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $goofyOutput = 'I am goofily sending output in the controller'; echo $goofyOutput; $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); @@ -1746,7 +1746,7 @@ class CakeResponseTest extends CakeTestCase { ); $this->assertEquals(416, $response->statusCode()); - $result = $response->send(); + $response->send(); } /** @@ -1787,7 +1787,7 @@ class CakeResponseTest extends CakeTestCase { ); ob_start(); - $result = $response->send(); + $response->send(); ob_get_clean(); } @@ -1876,7 +1876,7 @@ class CakeResponseTest extends CakeTestCase { ); $this->assertEquals(416, $response->statusCode()); - $result = $response->send(); + $response->send(); } /** diff --git a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php index 3be1a7f95..a86412ce6 100644 --- a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php +++ b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php @@ -21,7 +21,6 @@ App::uses('File', 'Utility'); /** * Help to test CakeEmail - * */ class TestCakeEmail extends CakeEmail { @@ -36,7 +35,6 @@ class TestCakeEmail extends CakeEmail { /** * Config - * */ protected $_config = array(); @@ -89,7 +87,6 @@ class TestCakeEmail extends CakeEmail { /** * EmailConfig class - * */ class TestEmailConfig { @@ -135,7 +132,6 @@ class TestEmailConfig { /** * ExtendTransport class * test class to ensure the class has send() method - * */ class ExtendTransport { @@ -217,7 +213,7 @@ class CakeEmailTest extends CakeTestCase { $this->assertSame($this->CakeEmail, $result); $this->setExpectedException('SocketException'); - $result = $this->CakeEmail->from(array('cake@cakephp.org' => 'CakePHP', 'fail@cakephp.org' => 'From can only be one address')); + $this->CakeEmail->from(array('cake@cakephp.org' => 'CakePHP', 'fail@cakephp.org' => 'From can only be one address')); } /** @@ -866,7 +862,7 @@ class CakeEmailTest extends CakeTestCase { $this->setExpectedException('SocketException'); $this->CakeEmail->transport('Invalid'); - $result = $this->CakeEmail->transportClass(); + $this->CakeEmail->transportClass(); } /** @@ -955,7 +951,7 @@ class CakeEmailTest extends CakeTestCase { $this->assertEquals($expected, $this->CakeEmail->transportClass()->config()); $this->CakeEmail->config(array('log' => true)); - $result = $this->CakeEmail->transportClass()->config(); + $this->CakeEmail->transportClass()->config(); $expected += array('log' => true); $this->assertEquals($expected, $this->CakeEmail->transportClass()->config()); @@ -2028,7 +2024,7 @@ class CakeEmailTest extends CakeTestCase { $this->assertEquals('html', $result); $this->setExpectedException('SocketException'); - $result = $this->CakeEmail->emailFormat('invalid'); + $this->CakeEmail->emailFormat('invalid'); } /** @@ -2385,7 +2381,6 @@ class CakeEmailTest extends CakeTestCase { style="font-weight: bold">The tag is across multiple lines HTML; - $length = strlen($str); $message = $str . str_repeat('x', CakeEmail::LINE_LENGTH_MUST + 1); $this->CakeEmail->reset(); diff --git a/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php b/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php index ca5653b49..9c6061c36 100644 --- a/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php @@ -22,7 +22,6 @@ App::uses('DebugTransport', 'Network/Email'); /** * Test case - * */ class DebugTransportTest extends CakeTestCase { diff --git a/lib/Cake/Test/Case/Network/Email/MailTransportTest.php b/lib/Cake/Test/Case/Network/Email/MailTransportTest.php index bccc95439..dde5eaa90 100644 --- a/lib/Cake/Test/Case/Network/Email/MailTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/MailTransportTest.php @@ -22,7 +22,6 @@ App::uses('MailTransport', 'Network/Email'); /** * Test case - * */ class MailTransportTest extends CakeTestCase { diff --git a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php index 7c4076439..478de6b98 100644 --- a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php @@ -22,14 +22,13 @@ App::uses('SmtpTransport', 'Network/Email'); /** * Help to test SmtpTransport - * */ class SmtpTestTransport extends SmtpTransport { /** * Helper to change the socket * - * @param object $socket + * @param CakeSocket $socket A socket. * @return void */ public function setSocket(CakeSocket $socket) { @@ -39,7 +38,7 @@ class SmtpTestTransport extends SmtpTransport { /** * Helper to change the CakeEmail * - * @param object $cakeEmail + * @param object $cakeEmail An email object. * @return void */ public function setCakeEmail($cakeEmail) { @@ -57,8 +56,8 @@ class SmtpTestTransport extends SmtpTransport { /** * Magic function to call protected methods * - * @param string $method - * @param string $args + * @param string $method The method to call. + * @param string $args The arguments. * @return mixed */ public function __call($method, $args) { @@ -70,7 +69,6 @@ class SmtpTestTransport extends SmtpTransport { /** * Test case - * */ class SmtpTransportTest extends CakeTestCase { diff --git a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php index 6ff788348..318e43401 100644 --- a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php +++ b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php @@ -29,8 +29,8 @@ class TestAuthentication { /** * authentication method * - * @param HttpSocket $http - * @param array $authInfo + * @param HttpSocket $http A HTTP socket. + * @param array &$authInfo Some auth info. * @return void */ public static function authentication(HttpSocket $http, &$authInfo) { @@ -40,8 +40,8 @@ class TestAuthentication { /** * proxyAuthentication method * - * @param HttpSocket $http - * @param array $proxyInfo + * @param HttpSocket $http A HTTP socket. + * @param array &$proxyInfo Some proxy info. * @return void */ public static function proxyAuthentication(HttpSocket $http, &$proxyInfo) { @@ -52,7 +52,6 @@ class TestAuthentication { /** * CustomResponse - * */ class CustomResponse { @@ -66,6 +65,7 @@ class CustomResponse { /** * Constructor * + * @param string $message A message. */ public function __construct($message) { $this->first10 = substr($message, 0, 10); @@ -75,7 +75,6 @@ class CustomResponse { /** * TestHttpSocket - * */ class TestHttpSocket extends HttpSocket { @@ -135,7 +134,6 @@ class TestHttpSocket extends HttpSocket { * Convenience method for testing protected method * * @param array $request Needs to contain a 'uri' key. Should also contain a 'method' key, otherwise defaults to GET. - * @param string $versionToken The version token to use, defaults to HTTP/1.1 * @return string Request line */ public function buildRequestLine($request = array()) { @@ -583,7 +581,7 @@ class HttpSocketTest extends CakeTestCase { $this->Socket->reset(); $request = array('method' => 'POST', 'uri' => 'http://www.cakephp.org/posts/add', 'body' => array('name' => 'HttpSocket-is-released', 'date' => 'today')); - $response = $this->Socket->request($request); + $this->Socket->request($request); $this->assertEquals("name=HttpSocket-is-released&date=today", $this->Socket->request['body']); } diff --git a/lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php b/lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php index e9e5b5ddd..c67cba384 100644 --- a/lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php +++ b/lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php @@ -258,7 +258,6 @@ class AssetDispatcherTest extends CakeTestCase { $file = file_get_contents($path); $this->assertEquals($file, $result); - $expected = filesize($path); $headers = $response->header(); $this->assertFalse($headers['Content-Length']); } diff --git a/lib/Cake/Test/Case/Routing/Route/RedirectRouteTest.php b/lib/Cake/Test/Case/Routing/Route/RedirectRouteTest.php index fe3b41ab8..4eb654047 100644 --- a/lib/Cake/Test/Case/Routing/Route/RedirectRouteTest.php +++ b/lib/Cake/Test/Case/Routing/Route/RedirectRouteTest.php @@ -47,14 +47,14 @@ class RedirectRouteTest extends CakeTestCase { $route = new RedirectRoute('/home', array('controller' => 'posts')); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/home'); + $route->parse('/home'); $header = $route->response->header(); $this->assertEquals(Router::url('/posts', true), $header['Location']); $route = new RedirectRoute('/home', array('controller' => 'posts', 'action' => 'index')); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/home'); + $route->parse('/home'); $header = $route->response->header(); $this->assertEquals(Router::url('/posts', true), $header['Location']); $this->assertEquals(301, $route->response->statusCode()); @@ -62,14 +62,14 @@ class RedirectRouteTest extends CakeTestCase { $route = new RedirectRoute('/google', 'http://google.com'); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/google'); + $route->parse('/google'); $header = $route->response->header(); $this->assertEquals('http://google.com', $header['Location']); $route = new RedirectRoute('/posts/*', array('controller' => 'posts', 'action' => 'view'), array('status' => 302)); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/posts/2'); + $route->parse('/posts/2'); $header = $route->response->header(); $this->assertEquals(Router::url('/posts/view', true), $header['Location']); $this->assertEquals(302, $route->response->statusCode()); @@ -77,35 +77,35 @@ class RedirectRouteTest extends CakeTestCase { $route = new RedirectRoute('/posts/*', array('controller' => 'posts', 'action' => 'view'), array('persist' => true)); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/posts/2'); + $route->parse('/posts/2'); $header = $route->response->header(); $this->assertEquals(Router::url('/posts/view/2', true), $header['Location']); $route = new RedirectRoute('/posts/*', '/test', array('persist' => true)); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/posts/2'); + $route->parse('/posts/2'); $header = $route->response->header(); $this->assertEquals(Router::url('/test', true), $header['Location']); $route = new RedirectRoute('/my_controllers/:action/*', array('controller' => 'tags', 'action' => 'add'), array('persist' => true)); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/my_controllers/do_something/passme/named:param'); + $route->parse('/my_controllers/do_something/passme/named:param'); $header = $route->response->header(); $this->assertEquals(Router::url('/tags/add/passme/named:param', true), $header['Location']); $route = new RedirectRoute('/my_controllers/:action/*', array('controller' => 'tags', 'action' => 'add')); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/my_controllers/do_something/passme/named:param'); + $route->parse('/my_controllers/do_something/passme/named:param'); $header = $route->response->header(); $this->assertEquals(Router::url('/tags/add', true), $header['Location']); $route = new RedirectRoute('/:lang/my_controllers', array('controller' => 'tags', 'action' => 'add'), array('lang' => '(nl|en)', 'persist' => array('lang'))); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/nl/my_controllers/'); + $route->parse('/nl/my_controllers/'); $header = $route->response->header(); $this->assertEquals(Router::url('/tags/add/lang:nl', true), $header['Location']); @@ -114,7 +114,7 @@ class RedirectRouteTest extends CakeTestCase { $route = new RedirectRoute('/:lang/my_controllers', array('controller' => 'tags', 'action' => 'add'), array('lang' => '(nl|en)', 'persist' => array('lang'))); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/nl/my_controllers/'); + $route->parse('/nl/my_controllers/'); $header = $route->response->header(); $this->assertEquals(Router::url('/nl/preferred_controllers', true), $header['Location']); } diff --git a/lib/Cake/Test/Case/Routing/RouterTest.php b/lib/Cake/Test/Case/Routing/RouterTest.php index 0a78cdedc..20d493bfe 100644 --- a/lib/Cake/Test/Case/Routing/RouterTest.php +++ b/lib/Cake/Test/Case/Routing/RouterTest.php @@ -201,7 +201,7 @@ class RouterTest extends CakeTestCase { )); CakePlugin::load('TestPlugin'); App::uses('TestRoute', 'TestPlugin.Routing/Route'); - $resources = Router::mapResources('Posts', array( + Router::mapResources('Posts', array( 'connectOptions' => array( 'routeClass' => 'TestPlugin.TestRoute', 'foo' => '^(bar)$', @@ -238,7 +238,7 @@ class RouterTest extends CakeTestCase { $this->assertEquals($expected, $result); $this->assertEquals(array('test_plugin'), $resources); - $resources = Router::mapResources('Posts', array('prefix' => 'api')); + Router::mapResources('Posts', array('prefix' => 'api')); $_SERVER['REQUEST_METHOD'] = 'GET'; $result = Router::parse('/api/posts'); @@ -1579,7 +1579,7 @@ class RouterTest extends CakeTestCase { $request->base = '/'; Router::setRequestInfo($request); - $result = Router::parse('/admin/controller/index/type:whatever'); + Router::parse('/admin/controller/index/type:whatever'); $result = Router::url(array('type' => 'new')); $expected = "/admin/controller/index/type:new"; $this->assertEquals($expected, $result); diff --git a/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php index d5cee102e..f9a677a9c 100644 --- a/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php @@ -327,7 +327,7 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextStartsWith() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; + // $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; $this->assertStringStartsWith("some\nstring", $stringDirty); $this->assertStringStartsNotWith("some\r\nstring\r\nwith", $stringDirty); @@ -344,7 +344,7 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextStartsNotWith() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; + // $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; $this->assertTextStartsNotWith("some\nstring\nwithout", $stringDirty); } @@ -356,7 +356,7 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextEndsWith() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; + // $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; $this->assertTextEndsWith("string\nwith\r\ndifferent\rline endings!", $stringDirty); $this->assertTextEndsWith("string\r\nwith\ndifferent\nline endings!", $stringDirty); @@ -369,7 +369,7 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextEndsNotWith() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; + // $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; $this->assertStringEndsNotWith("different\nline endings", $stringDirty); $this->assertTextEndsNotWith("different\rline endings", $stringDirty); @@ -382,7 +382,7 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextContains() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; + // $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; $this->assertContains("different", $stringDirty); $this->assertNotContains("different\rline", $stringDirty); @@ -397,7 +397,7 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextNotContains() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; + // $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; $this->assertTextNotContains("different\rlines", $stringDirty); } @@ -460,7 +460,7 @@ class CakeTestCaseTest extends CakeTestCase { ), App::RESET); CakePlugin::load('TestPlugin'); $this->getMockForModel('TestPlugin.TestPluginAppModel'); - $TestPluginComment = $this->getMockForModel('TestPlugin.TestPluginComment'); + $this->getMockForModel('TestPlugin.TestPluginComment'); $result = ClassRegistry::init('TestPlugin.TestPluginComment'); $this->assertInstanceOf('TestPluginComment', $result); diff --git a/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php b/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php index 1a04dae0f..b50e21926 100644 --- a/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php +++ b/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php @@ -534,7 +534,7 @@ class CakeTestFixtureTest extends CakeTestCase { */ public function testInsertInvalid() { $Fixture = new InvalidTestFixture(); - $return = $Fixture->insert($this->criticDb); + $Fixture->insert($this->criticDb); } /** diff --git a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php index bade7e034..efd8878d8 100644 --- a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php @@ -276,7 +276,7 @@ class ControllerTestCaseTest extends CakeTestCase { * @return void */ public function testTestAction() { - $Controller = $this->Case->generate('TestsApps'); + $this->Case->generate('TestsApps'); $this->Case->testAction('/tests_apps/index'); $this->assertInternalType('array', $this->Case->controller->viewVars); @@ -306,7 +306,7 @@ class ControllerTestCaseTest extends CakeTestCase { * @return void */ public function testTestActionArrayUrls() { - $Controller = $this->Case->generate('TestsApps'); + $this->Case->generate('TestsApps'); $this->Case->testAction(array('controller' => 'tests_apps', 'action' => 'index')); $this->assertInternalType('array', $this->Case->controller->viewVars); } @@ -452,7 +452,7 @@ class ControllerTestCaseTest extends CakeTestCase { public function testTestActionGetData() { $this->Case->autoMock = true; - $result = $this->Case->testAction('/tests_apps_posts/url_var', array( + $this->Case->testAction('/tests_apps_posts/url_var', array( 'method' => 'get', 'data' => array( 'some' => 'var', @@ -474,7 +474,7 @@ class ControllerTestCaseTest extends CakeTestCase { )); $this->assertEquals(array('gogo', 'val2'), $result['params']['pass']); - $result = $this->Case->testAction('/tests_apps_posts/url_var', array( + $this->Case->testAction('/tests_apps_posts/url_var', array( 'return' => 'vars', 'method' => 'get', 'data' => array( diff --git a/lib/Cake/Test/Case/Utility/FolderTest.php b/lib/Cake/Test/Case/Utility/FolderTest.php index 67ab0cce9..552922818 100644 --- a/lib/Cake/Test/Case/Utility/FolderTest.php +++ b/lib/Cake/Test/Case/Utility/FolderTest.php @@ -1026,7 +1026,7 @@ class FolderTest extends CakeTestCase { extract($this->_setupFilesystem()); $Folder = new Folder($folderOne); - $result = $Folder->copy(array('to' => $folderThree, 'scheme' => Folder::OVERWRITE)); + $Folder->copy(array('to' => $folderThree, 'scheme' => Folder::OVERWRITE)); $this->assertTrue(file_exists($folderThree . DS . 'file1.php')); $this->assertTrue(file_exists($folderThree . DS . 'folderA' . DS . 'fileA.php')); diff --git a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php index 4d768d0d8..7d2eade79 100644 --- a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php +++ b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php @@ -27,8 +27,8 @@ class GenericObject { /** * Constructor * - * @param GenericObjectCollection $collection - * @param array $settings + * @param GenericObjectCollection $collection A collection. + * @param array $settings Settings. */ public function __construct(GenericObjectCollection $collection, $settings = array()) { $this->_Collection = $collection; diff --git a/lib/Cake/Test/Case/Utility/SanitizeTest.php b/lib/Cake/Test/Case/Utility/SanitizeTest.php index 524e8ab49..b6112c124 100644 --- a/lib/Cake/Test/Case/Utility/SanitizeTest.php +++ b/lib/Cake/Test/Case/Utility/SanitizeTest.php @@ -154,7 +154,7 @@ class SanitizeTest extends CakeTestCase { $string = ''; $expected = ''; $result = Sanitize::clean($string, array('connection' => 'test')); - $this->assertEquals($expected, $string); + $this->assertEquals($expected, $result); $data = array( 'Grant' => array( diff --git a/lib/Cake/Test/Case/Utility/SecurityTest.php b/lib/Cake/Test/Case/Utility/SecurityTest.php index bc81aecfe..90ea96c86 100644 --- a/lib/Cake/Test/Case/Utility/SecurityTest.php +++ b/lib/Cake/Test/Case/Utility/SecurityTest.php @@ -324,7 +324,7 @@ class SecurityTest extends CakeTestCase { public function testDecryptKeyFailure() { $txt = 'The quick brown fox'; $key = 'This key is longer than 32 bytes long.'; - $result = Security::encrypt($txt, $key); + Security::encrypt($txt, $key); $key = 'Not the same key. This one will fail'; $this->assertFalse(Security::decrypt($txt, $key), 'Modified key will fail.'); diff --git a/lib/Cake/Test/Case/Utility/SetTest.php b/lib/Cake/Test/Case/Utility/SetTest.php index f55afd106..6097191db 100644 --- a/lib/Cake/Test/Case/Utility/SetTest.php +++ b/lib/Cake/Test/Case/Utility/SetTest.php @@ -2763,7 +2763,6 @@ class SetTest extends CakeTestCase { /** * testSetApply method * @return void - * */ public function testApply() { $data = array( diff --git a/lib/Cake/Test/Case/Utility/ValidationTest.php b/lib/Cake/Test/Case/Utility/ValidationTest.php index f501e4f6b..7c5dca576 100644 --- a/lib/Cake/Test/Case/Utility/ValidationTest.php +++ b/lib/Cake/Test/Case/Utility/ValidationTest.php @@ -28,7 +28,7 @@ class CustomValidator { /** * Makes sure that a given $email address is valid and unique * - * @param string $email + * @param string $check Email to check. * @return bool */ public static function customValidate($check) { diff --git a/lib/Cake/Test/Case/Utility/XmlTest.php b/lib/Cake/Test/Case/Utility/XmlTest.php index 614a22a05..5cb62d0f8 100644 --- a/lib/Cake/Test/Case/Utility/XmlTest.php +++ b/lib/Cake/Test/Case/Utility/XmlTest.php @@ -175,7 +175,7 @@ class XmlTest extends CakeTestCase { */ public function testBuildFromFileWhenDisabled() { $xml = CAKE . 'Test' . DS . 'Fixture' . DS . 'sample.xml'; - $obj = Xml::build($xml, array('readFile' => false)); + Xml::build($xml, array('readFile' => false)); } /** @@ -186,7 +186,7 @@ class XmlTest extends CakeTestCase { */ public function testBuildFromUrlWhenDisabled() { $xml = 'http://www.google.com'; - $obj = Xml::build($xml, array('readFile' => false)); + Xml::build($xml, array('readFile' => false)); } /** @@ -222,7 +222,7 @@ class XmlTest extends CakeTestCase { */ public function testBuildInvalidDataSimpleXml() { $input = ' 'simplexml')); + Xml::build($input, array('return' => 'simplexml')); } /** diff --git a/lib/Cake/Test/bake_compare/Controller/Scaffold.ctp b/lib/Cake/Test/bake_compare/Controller/Scaffold.ctp index 325fdb991..757e0eabd 100644 --- a/lib/Cake/Test/bake_compare/Controller/Scaffold.ctp +++ b/lib/Cake/Test/bake_compare/Controller/Scaffold.ctp @@ -2,7 +2,6 @@ App::uses('AppController', 'Controller'); /** * Articles Controller - * */ class ArticlesController extends AppController { diff --git a/lib/Cake/Test/test_app/Model/Datasource/Session/TestAppLibSession.php b/lib/Cake/Test/test_app/Model/Datasource/Session/TestAppLibSession.php index e7b5f9f30..2ba874dba 100644 --- a/lib/Cake/Test/test_app/Model/Datasource/Session/TestAppLibSession.php +++ b/lib/Cake/Test/test_app/Model/Datasource/Session/TestAppLibSession.php @@ -1,7 +1,6 @@ 0): echo $this->element('exception_stack_trace'); endif; -?> diff --git a/lib/Cake/Test/test_app/View/Elements/html_call.ctp b/lib/Cake/Test/test_app/View/Elements/html_call.ctp index 8c2c08978..fb5122dd2 100644 --- a/lib/Cake/Test/test_app/View/Elements/html_call.ctp +++ b/lib/Cake/Test/test_app/View/Elements/html_call.ctp @@ -1,3 +1,2 @@ Html->link('Test', 'http://example.com'); -?> \ No newline at end of file +echo $this->Html->link('Test', 'http://example.com'); \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Emails/html/default.ctp b/lib/Cake/Test/test_app/View/Emails/html/default.ctp index 5d6eabd09..538e907f5 100644 --- a/lib/Cake/Test/test_app/View/Emails/html/default.ctp +++ b/lib/Cake/Test/test_app/View/Emails/html/default.ctp @@ -3,5 +3,4 @@ $content = explode("\n", $content); foreach ($content as $line): echo '

' . $line . '

'; -endforeach; -?> \ No newline at end of file +endforeach; \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Layouts/ajax2.ctp b/lib/Cake/Test/test_app/View/Layouts/ajax2.ctp index 433315990..25c20f425 100644 --- a/lib/Cake/Test/test_app/View/Layouts/ajax2.ctp +++ b/lib/Cake/Test/test_app/View/Layouts/ajax2.ctp @@ -1,2 +1,3 @@ Ajax! -fetch('content'); ?> \ No newline at end of file +fetch('content'); \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Layouts/rss/default.ctp b/lib/Cake/Test/test_app/View/Layouts/rss/default.ctp index df2f0ab19..f0af9c0d8 100644 --- a/lib/Cake/Test/test_app/View/Layouts/rss/default.ctp +++ b/lib/Cake/Test/test_app/View/Layouts/rss/default.ctp @@ -12,6 +12,4 @@ echo $this->Rss->document( $this->Rss->channel( array(), $channel, $this->fetch('content') ) -); - -?> \ No newline at end of file +); \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Posts/helper_overwrite.ctp b/lib/Cake/Test/test_app/View/Posts/helper_overwrite.ctp index 100c5f51b..610d33ad9 100644 --- a/lib/Cake/Test/test_app/View/Posts/helper_overwrite.ctp +++ b/lib/Cake/Test/test_app/View/Posts/helper_overwrite.ctp @@ -1,4 +1,3 @@ Html->link('Test link', '#'); -?> \ No newline at end of file +echo $this->Html->link('Test link', '#'); \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Posts/parent_view.ctp b/lib/Cake/Test/test_app/View/Posts/parent_view.ctp index e338b784f..ee4689544 100644 --- a/lib/Cake/Test/test_app/View/Posts/parent_view.ctp +++ b/lib/Cake/Test/test_app/View/Posts/parent_view.ctp @@ -1,2 +1,2 @@ Parent View. -fetch('content') ?> +fetch('content'); ?> diff --git a/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp b/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp index c0b2ac283..19a88e339 100644 --- a/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp +++ b/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp @@ -47,7 +47,7 @@ Html->image('test.jpg') ?> \ No newline at end of file +Html->image('test.jpg'); ?> \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Themed/TestTheme/Layouts/default.ctp b/lib/Cake/Test/test_app/View/Themed/TestTheme/Layouts/default.ctp index 9f2aa062d..d4e3dd586 100644 --- a/lib/Cake/Test/test_app/View/Themed/TestTheme/Layouts/default.ctp +++ b/lib/Cake/Test/test_app/View/Themed/TestTheme/Layouts/default.ctp @@ -1,2 +1,2 @@ default test_theme layout -fetch('content') ?> +fetch('content'); ?> diff --git a/lib/Cake/TestSuite/CakeTestCase.php b/lib/Cake/TestSuite/CakeTestCase.php index bcecc45a3..c375717fe 100644 --- a/lib/Cake/TestSuite/CakeTestCase.php +++ b/lib/Cake/TestSuite/CakeTestCase.php @@ -643,9 +643,9 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase { /** * Compatibility wrapper function for setExpectedException * - * @param mixed $expected the name of the Exception + * @param mixed $name The name of the expected Exception. * @param string $message the text to display if the assertion is not correct - * @deprecated 3.0.0 This is a compatiblity wrapper for 1.x. It will be removed in 3.0 + * @deprecated 3.0.0 This is a compatibility wrapper for 1.x. It will be removed in 3.0. * @return void */ protected function expectException($name = 'Exception', $message = '') { diff --git a/lib/Cake/TestSuite/CakeTestLoader.php b/lib/Cake/TestSuite/CakeTestLoader.php index c1fa85f10..3fe681bde 100644 --- a/lib/Cake/TestSuite/CakeTestLoader.php +++ b/lib/Cake/TestSuite/CakeTestLoader.php @@ -42,9 +42,9 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader { /** * Convert path fragments used by CakePHP's test runner to absolute paths that can be fed to PHPUnit. * - * @param string $filePath The file path to load - * @param string $params Additional parameters - * @return void + * @param string $filePath The file path to load. + * @param string $params Additional parameters. + * @return string Converted path fragments. */ protected function _resolveTestFile($filePath, $params) { $basePath = $this->_basePath($params) . DS . $filePath; diff --git a/lib/Cake/TestSuite/ControllerTestCase.php b/lib/Cake/TestSuite/ControllerTestCase.php index 17620ae08..03d78011a 100644 --- a/lib/Cake/TestSuite/ControllerTestCase.php +++ b/lib/Cake/TestSuite/ControllerTestCase.php @@ -258,7 +258,7 @@ abstract class ControllerTestCase extends CakeTestCase { $Dispatch->parseParams(new CakeEvent('ControllerTestCase', $Dispatch, array('request' => $request))); if (!isset($request->params['controller']) && Router::currentRoute()) { $this->headers = Router::currentRoute()->response->header(); - return; + return null; } if ($this->_dirtyController) { $this->controller = null; diff --git a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php index 3e68005f3..d877d556f 100644 --- a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php +++ b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php @@ -58,7 +58,7 @@ class CakeHtmlReporter extends CakeBaseReporter { */ public function paintDocumentStart() { ob_start(); - $baseDir = $this->params['baseDir']; + $this->params['baseDir']; include CAKE . 'TestSuite' . DS . 'templates' . DS . 'header.php'; } @@ -69,7 +69,7 @@ class CakeHtmlReporter extends CakeBaseReporter { * @return void */ public function paintTestMenu() { - $cases = $this->baseUrl() . '?show=cases'; + $this->baseUrl() . '?show=cases'; $plugins = App::objects('plugin', null, false); sort($plugins); include CAKE . 'TestSuite' . DS . 'templates' . DS . 'menu.php'; diff --git a/lib/Cake/TestSuite/templates/header.php b/lib/Cake/TestSuite/templates/header.php index 616bc179f..60afa7559 100644 --- a/lib/Cake/TestSuite/templates/header.php +++ b/lib/Cake/TestSuite/templates/header.php @@ -106,7 +106,7 @@ div.code-coverage-results span.line-num strong { color:#666; } div.code-coverage-results div.start { border:1px solid #aaa; - border-width:1px 1px 0px 1px; + border-width:1px 1px 0 1px; margin-top:30px; padding-top:5px; } From 5eedc0f2bb54ac4434e9feb6a453f4345ba4836c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Fri, 25 Sep 2015 17:55:01 +0200 Subject: [PATCH 2/3] Fix broken test --- lib/Cake/Console/Templates/default/classes/controller.ctp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Console/Templates/default/classes/controller.ctp b/lib/Cake/Console/Templates/default/classes/controller.ctp index 3e5a3004e..6beb4b401 100644 --- a/lib/Cake/Console/Templates/default/classes/controller.ctp +++ b/lib/Cake/Console/Templates/default/classes/controller.ctp @@ -23,10 +23,10 @@ echo "App::uses('{$plugin}AppController', '{$pluginPath}Controller');\n"; ?> /** * Controller - * Date: Fri, 25 Sep 2015 20:10:47 +0200 Subject: [PATCH 3/3] Removed $stringClean Resfs: https://github.com/cakephp/cakephp/pull/7448#discussion_r40450663 --- lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php index f9a677a9c..da97150c3 100644 --- a/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php @@ -327,7 +327,6 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextStartsWith() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - // $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; $this->assertStringStartsWith("some\nstring", $stringDirty); $this->assertStringStartsNotWith("some\r\nstring\r\nwith", $stringDirty); @@ -344,8 +343,6 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextStartsNotWith() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - // $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; - $this->assertTextStartsNotWith("some\nstring\nwithout", $stringDirty); } @@ -356,8 +353,6 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextEndsWith() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - // $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; - $this->assertTextEndsWith("string\nwith\r\ndifferent\rline endings!", $stringDirty); $this->assertTextEndsWith("string\r\nwith\ndifferent\nline endings!", $stringDirty); } @@ -369,8 +364,6 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextEndsNotWith() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - // $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; - $this->assertStringEndsNotWith("different\nline endings", $stringDirty); $this->assertTextEndsNotWith("different\rline endings", $stringDirty); } @@ -382,11 +375,8 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextContains() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - // $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; - $this->assertContains("different", $stringDirty); $this->assertNotContains("different\rline", $stringDirty); - $this->assertTextContains("different\rline", $stringDirty); } @@ -397,8 +387,6 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextNotContains() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - // $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; - $this->assertTextNotContains("different\rlines", $stringDirty); }