assertEquals($expected, $this->compiler->compileString($string)); } public function testVerbatimBlocksWithMultipleLinesAreCompiled() { $string = 'Some text @verbatim {{ $a }} @if($b) {{ $b }} @endif @endverbatim'; $expected = 'Some text {{ $a }} @if($b) {{ $b }} @endif '; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testMultipleVerbatimBlocksAreCompiled() { $string = '@verbatim {{ $a }} @endverbatim {{ $b }} @verbatim {{ $c }} @endverbatim'; $expected = ' {{ $a }} {{ $c }} '; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testRawBlocksAreRenderedInTheRightOrder() { $string = '@php echo "#1"; @endphp @verbatim {{ #2 }} @endverbatim @verbatim {{ #3 }} @endverbatim @php echo "#4"; @endphp'; $expected = ' {{ #2 }} {{ #3 }} '; $this->assertSame($expected, $this->compiler->compileString($string)); } public function testMultilineTemplatesWithRawBlocksAreRenderedInTheRightOrder() { $string = '{{ $first }} @php echo $second; @endphp @if ($conditional) {{ $third }} @endif @include("users") @verbatim {{ $fourth }} @include("test") @endverbatim @php echo $fifth; @endphp'; $expected = ' make("users", \Illuminate\Support\Arr::except(get_defined_vars(), [\'__data\', \'__path\']))->render(); ?> {{ $fourth }} @include("test") '; $this->assertSame($expected, $this->compiler->compileString($string)); } public function testRawBlocksDontGetMixedUpWhenSomeAreRemovedByBladeComments() { $string = '{{-- @verbatim Block #1 @endverbatim --}} @php "Block #2" @endphp'; $expected = ' '; $this->assertSame($expected, $this->compiler->compileString($string)); } }