|
|
@@ -15,7 +15,6 @@ declare(strict_types=1);
|
|
|
*/
|
|
|
namespace Cake\Test\TestCase\Log\Engine;
|
|
|
|
|
|
-use Cake\ORM\Entity;
|
|
|
use Cake\TestSuite\TestCase;
|
|
|
use Psr\Log\LogLevel;
|
|
|
use TestApp\Log\Engine\TestBaseLog;
|
|
|
@@ -57,58 +56,4 @@ class BaseLogTest extends TestCase
|
|
|
|
|
|
$this->assertUnescapedUnicode($this->testData, $logged);
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * Tests the logging output of an array containing unicode characters.
|
|
|
- */
|
|
|
- public function testLogUnicodeArray()
|
|
|
- {
|
|
|
- $logged = $this->logger->log(LogLevel::INFO, $this->testData);
|
|
|
-
|
|
|
- $this->assertUnescapedUnicode($this->testData, $logged);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Tests the logging output of an object implementing __toString().
|
|
|
- * Note: __toString() will return a single string containing unicode characters.
|
|
|
- */
|
|
|
- public function testLogUnicodeObjectToString()
|
|
|
- {
|
|
|
- $stub = $this->getMockBuilder(\stdClass::class)
|
|
|
- ->setMethods(['__toString'])
|
|
|
- ->getMock();
|
|
|
- $stub->method('__toString')
|
|
|
- ->willReturn(implode($this->testData));
|
|
|
-
|
|
|
- $logged = $this->logger->log(LogLevel::INFO, $stub);
|
|
|
-
|
|
|
- $this->assertUnescapedUnicode($this->testData, $logged);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Tests the logging output of an object implementing jsonSerializable().
|
|
|
- * Note: jsonSerializable() will return an array containing unicode characters.
|
|
|
- */
|
|
|
- public function testLogUnicodeObjectJsonSerializable()
|
|
|
- {
|
|
|
- $stub = $this->createMock(\JsonSerializable::class);
|
|
|
- $stub->method('jsonSerialize')
|
|
|
- ->willReturn($this->testData);
|
|
|
-
|
|
|
- $logged = $this->logger->log(LogLevel::INFO, $stub);
|
|
|
-
|
|
|
- $this->assertUnescapedUnicode($this->testData, $logged);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Tests the logging output of an entity with property value that contains unicode characters.
|
|
|
- */
|
|
|
- public function testLogUnicodeEntity()
|
|
|
- {
|
|
|
- $entity = new Entity(['foo' => implode($this->testData)]);
|
|
|
-
|
|
|
- $logged = $this->logger->log(LogLevel::INFO, $entity);
|
|
|
-
|
|
|
- $this->assertUnescapedUnicode($this->testData, $logged);
|
|
|
- }
|
|
|
}
|