1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
<?php
namespace Illuminate\Tests\View\Blade;
class BladeWhileStatementsTest extends AbstractBladeTestCase
{
public function testWhileStatementsAreCompiled()
{
$string = '@while ($foo)
test
@endwhile';
$expected = '<?php while($foo): ?>
test
<?php endwhile; ?>';
$this->assertEquals($expected, $this->compiler->compileString($string));
}
public function testNestedWhileStatementsAreCompiled()
{
$string = '@while ($foo)
@while ($bar)
test
@endwhile
@endwhile';
$expected = '<?php while($foo): ?>
<?php while($bar): ?>
test
<?php endwhile; ?>
<?php endwhile; ?>';
$this->assertEquals($expected, $this->compiler->compileString($string));
}
}
|