first commit
This commit is contained in:
29
modules/ps_eventbus/tests/unit/JsonFormatterTest.php
Normal file
29
modules/ps_eventbus/tests/unit/JsonFormatterTest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use PrestaShop\Module\PsEventbus\Formatter\JsonFormatter;
|
||||
|
||||
class JsonFormatterTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var JsonFormatter
|
||||
*/
|
||||
private $jsonFormatter;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->jsonFormatter = new JsonFormatter();
|
||||
}
|
||||
|
||||
public function testFormatNewlineJsonString()
|
||||
{
|
||||
$data = [
|
||||
['test' => 'data'],
|
||||
['test2' => 'data2'],
|
||||
];
|
||||
|
||||
$this->assertTrue(is_string($this->jsonFormatter->formatNewlineJsonString($data)));
|
||||
$this->assertRegExp("/\r\n/", $this->jsonFormatter->formatNewlineJsonString($data));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user