-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Trim whitespaces in JSON decode helper (#603)
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Tests/Unit/ViewHelpers/Format/Json/DecodeViewHelperTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the "headless" Extension for TYPO3 CMS. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.md file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace FriendsOfTYPO3\Headless\Tests\Unit\ViewHelpers\Format\Json; | ||
|
||
use FriendsOfTYPO3\Headless\ViewHelpers\Format\Json\DecodeViewHelper; | ||
use TYPO3\TestingFramework\Core\Unit\UnitTestCase; | ||
|
||
class DecodeViewHelperTest extends UnitTestCase | ||
{ | ||
public function testRender(): void | ||
{ | ||
$GLOBALS['TYPO3_CONF_VARS']['FE']['debug'] = true; | ||
$decodeViewHelper = new DecodeViewHelper(); | ||
$decodeViewHelper->setArguments(['json' => null]); | ||
$decodeViewHelper->setRenderChildrenClosure(function () { return "\n \n"; }); | ||
$result = $decodeViewHelper->render(); | ||
self::assertNull($result); | ||
} | ||
} |