/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/View/Blade/BladeBreakStatementsTest.php
71 строка
2 KB
Lucas Michot
[5.5] Let PHPUnit setup Blade tests. (#19675)
19 июн 2017, 16:25
19 июн 2017, 16:25
59ee769
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\View\Blade; class BladeBreakStatementsTest extends AbstractBladeTestCase { public function testBreakStatementsAreCompiled() { $string = '@for ($i = 0; $i < 10; $i++) test @break @endfor'; $expected = '<?php for($i = 0; $i < 10; $i++): ?> test <?php break; ?> <?php endfor; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testBreakStatementsWithExpressionAreCompiled() { $string = '@for ($i = 0; $i < 10; $i++) test @break(TRUE) @endfor'; $expected = '<?php for($i = 0; $i < 10; $i++): ?> test <?php if(TRUE) break; ?> <?php endfor; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testBreakStatementsWithArgumentAreCompiled() { $string = '@for ($i = 0; $i < 10; $i++) test @break(2) @endfor'; $expected = '<?php for($i = 0; $i < 10; $i++): ?> test <?php break 2; ?> <?php endfor; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testBreakStatementsWithSpacedArgumentAreCompiled() { $string = '@for ($i = 0; $i < 10; $i++) test @break( 2 ) @endfor'; $expected = '<?php for($i = 0; $i < 10; $i++): ?> test <?php break 2; ?> <?php endfor; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testBreakStatementsWithFaultyArgumentAreCompiled() { $string = '@for ($i = 0; $i < 10; $i++) test @break(-2) @endfor'; $expected = '<?php for($i = 0; $i < 10; $i++): ?> test <?php break 1; ?> <?php endfor; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } }