Skip to content

Commit

Permalink
[TASK] Add a child content based test for v:format.replace
Browse files Browse the repository at this point in the history
  • Loading branch information
NamelessCoder committed Jul 18, 2024
1 parent 5e2f7f8 commit 9cb0126
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Tests/Unit/ViewHelpers/Format/ReplaceViewHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\AbstractViewHelperTest;
use FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\AbstractViewHelperTestCase;
use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\TextNode;

class ReplaceViewHelperTest extends AbstractViewHelperTestCase
{
Expand All @@ -24,6 +25,16 @@ public function testCanReplace(): void
$this->assertSame('bar', $test);
}

public function testCanReplaceWithChildContent(): void
{
$arguments = [
'substring' => 'foo',
'replacement' => '',
];
$test = $this->executeViewHelper($arguments, [], new TextNode('foobar'));
$this->assertSame('bar', $test);
}

public function testCanReplaceWithArrays(): void
{
$arguments = [
Expand Down

0 comments on commit 9cb0126

Please sign in to comment.