mscherer 6 years ago
parent
commit
5e005c6731

+ 1 - 1
src/Model/Behavior/JsonableBehavior.php

@@ -113,7 +113,7 @@ class JsonableBehavior extends Behavior {
 	public function beforeFind(Event $event, Query $query, ArrayObject $options, $primary) {
 		$query->formatResults(function (CollectionInterface $results) {
 			return $results->map(function ($row) {
-				if (!$row instanceOf Entity) {
+				if (!$row instanceof Entity) {
 					return $row;
 				}
 

+ 1 - 1
src/Utility/Text.php

@@ -446,7 +446,7 @@ class Text extends CakeText {
 	 * @param string $str
 	 * @return string
 	 */
-	public function reduce_double_slashes($str) {
+	public function reduceDoubleSlashes($str) {
 		return preg_replace('#([^:])//+#', '\\1/', $str);
 	}
 

+ 4 - 27
tests/TestCase/Utility/MimeTest.php

@@ -2,10 +2,10 @@
 
 namespace Tools\Test\TestCase\Utility;
 
+use App\Http\TestResponse;
+use App\Utility\TestMime;
 use Cake\Core\Plugin;
-use Cake\Http\Response;
 use Tools\TestSuite\TestCase;
-use Tools\Utility\Mime;
 
 class MimeTest extends TestCase {
 
@@ -20,7 +20,7 @@ class MimeTest extends TestCase {
 	public function setUp() {
 		parent::setUp();
 
-		$this->Mime = new Mime();
+		$this->Mime = new TestMime();
 	}
 
 	/**
@@ -142,7 +142,7 @@ class MimeTest extends TestCase {
 	 * @return void
 	 */
 	public function testDifferenceBetweenPluginAndCore() {
-		$this->TestCakeResponse = new TestCakeResponse();
+		$this->TestCakeResponse = new TestResponse();
 		$this->TestMime = new TestMime();
 
 		$core = $this->TestCakeResponse->getMimeTypes();
@@ -167,26 +167,3 @@ class MimeTest extends TestCase {
 	}
 
 }
-
-class TestCakeResponse extends Response {
-
-	/**
-	 * @return array
-	 */
-	public function getMimeTypes() {
-		return $this->_mimeTypes;
-	}
-
-}
-
-class TestMime extends Mime {
-
-	/**
-	 * @param bool $coreHasPrecedence
-	 * @return array
-	 */
-	public function getMimeTypes($coreHasPrecedence = false) {
-		return $this->_mimeTypesExt;
-	}
-
-}

+ 16 - 0
tests/test_app/Http/TestResponse.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Http;
+
+use Cake\Http\Response;
+
+class TestResponse extends Response {
+
+	/**
+	 * @return array
+	 */
+	public function getMimeTypes() {
+		return $this->_mimeTypes;
+	}
+
+}

+ 17 - 0
tests/test_app/Utility/TestMime.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Utility;
+
+use Tools\Utility\Mime;
+
+class TestMime extends Mime {
+
+	/**
+	 * @param bool $coreHasPrecedence
+	 * @return array
+	 */
+	public function getMimeTypes($coreHasPrecedence = false) {
+		return $this->_mimeTypesExt;
+	}
+
+}