From a7fcb0a61c84a08567beded1e1c329859d97385f Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 12 Nov 2011 21:40:51 -0500 Subject: [PATCH] Fix more strict errors. --- lib/Cake/Core/App.php | 2 +- lib/Cake/Test/Case/Core/ObjectTest.php | 2 +- lib/Cake/Test/Case/Network/CakeResponseTest.php | 11 +++++++---- .../Plugin/TestPlugin/Model/Datasource/TestSource.php | 10 +++++----- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index c76008ab4..356fd96e5 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -666,7 +666,7 @@ class App { * @param boolean $return whether this function should return the contents of the file after being parsed by php or just a success notice * @return mixed if $return contents of the file after php parses it, boolean indicating success otherwise */ - protected function _loadFile($name, $plugin, $search, $file, $return) { + protected static function _loadFile($name, $plugin, $search, $file, $return) { $mapped = self::_mapped($name, $plugin); if ($mapped) { $file = $mapped; diff --git a/lib/Cake/Test/Case/Core/ObjectTest.php b/lib/Cake/Test/Case/Core/ObjectTest.php index 1b63c0bb2..51ee67bce 100644 --- a/lib/Cake/Test/Case/Core/ObjectTest.php +++ b/lib/Cake/Test/Case/Core/ObjectTest.php @@ -490,7 +490,7 @@ class ObjectTest extends CakeTestCase { App::build(array( 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), ), true); - CakePlugin::loadAll(); + CakePlugin::load('TestPlugin'); Router::reload(); $result = $this->object->requestAction('/test_plugin/tests/index', array('return')); diff --git a/lib/Cake/Test/Case/Network/CakeResponseTest.php b/lib/Cake/Test/Case/Network/CakeResponseTest.php index d5d2d3e41..496e8eee1 100644 --- a/lib/Cake/Test/Case/Network/CakeResponseTest.php +++ b/lib/Cake/Test/Case/Network/CakeResponseTest.php @@ -300,11 +300,14 @@ class CakeResponseTest extends CakeTestCase { } /** -* Tests the compress method -* -*/ + * Tests the compress method + * + * @return void + */ public function testCompress() { - $this->skipIf(php_sapi_name() !== 'cli', 'The response compression can only be tested in cli.'); + if (php_sapi_name() !== 'cli') { + $this->markTestSkipped('The response compression can only be tested in cli.'); + } $response = new CakeResponse(); if (ini_get("zlib.output_compression") === '1' || !extension_loaded("zlib")) { diff --git a/lib/Cake/Test/test_app/Plugin/TestPlugin/Model/Datasource/TestSource.php b/lib/Cake/Test/test_app/Plugin/TestPlugin/Model/Datasource/TestSource.php index 3f8eb52c9..371d86a98 100644 --- a/lib/Cake/Test/test_app/Plugin/TestPlugin/Model/Datasource/TestSource.php +++ b/lib/Cake/Test/test_app/Plugin/TestPlugin/Model/Datasource/TestSource.php @@ -7,23 +7,23 @@ class TestSource extends DataSource { return compact('model'); } - public function listSources() { + public function listSources($data = null) { return array('test_source'); } - public function create($model, $fields = array(), $values = array()) { + public function create(Model $model, $fields = array(), $values = array()) { return compact('model', 'fields', 'values'); } - public function read($model, $queryData = array()) { + public function read(Model $model, $queryData = array()) { return compact('model', 'queryData'); } - public function update($model, $fields = array(), $values = array()) { + public function update(Model $model, $fields = array(), $values = array()) { return compact('model', 'fields', 'values'); } - public function delete($model, $id) { + public function delete(Model $model, $id = null) { return compact('model', 'id'); } }