Skip to content

Commit

Permalink
Add test for @php blade tag (#45501)
Browse files Browse the repository at this point in the history
  • Loading branch information
imanghafoori1 committed Jan 4, 2023
1 parent a862446 commit 140eb47
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/View/Blade/BladePhpStatementsTest.php
Expand Up @@ -11,6 +11,14 @@ public function testPhpStatementsWithExpressionAreCompiled()
$this->assertEquals($expected, $this->compiler->compileString($string));
}

public function testStringWithParenthesisWithEndPHP()
{
$string = "@php(\$data = ['related_to' => 'issue#45388'];) {{ \$data }} @endphp";
$expected = "<?php(\$data = ['related_to' => 'issue#45388'];) {{ \$data }} ?>";

$this->assertEquals($expected, $this->compiler->compileString($string));
}

public function testPhpStatementsWithoutExpressionAreIgnored()
{
$string = '@php';
Expand Down

0 comments on commit 140eb47

Please sign in to comment.