/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/View/Blade/BladeContinueStatementsTest.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 BladeContinueStatementsTest extends AbstractBladeTestCase { public function testContinueStatementsAreCompiled() { $string = '@for ($i = 0; $i < 10; $i++) test @continue @endfor'; $expected = '<?php for($i = 0; $i < 10; $i++): ?> test <?php continue; ?> <?php endfor; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testContinueStatementsWithExpressionAreCompiled() { $string = '@for ($i = 0; $i < 10; $i++) test @continue(TRUE) @endfor'; $expected = '<?php for($i = 0; $i < 10; $i++): ?> test <?php if(TRUE) continue; ?> <?php endfor; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testContinueStatementsWithArgumentAreCompiled() { $string = '@for ($i = 0; $i < 10; $i++) test @continue(2) @endfor'; $expected = '<?php for($i = 0; $i < 10; $i++): ?> test <?php continue 2; ?> <?php endfor; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testContinueStatementsWithSpacedArgumentAreCompiled() { $string = '@for ($i = 0; $i < 10; $i++) test @continue( 2 ) @endfor'; $expected = '<?php for($i = 0; $i < 10; $i++): ?> test <?php continue 2; ?> <?php endfor; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testContinueStatementsWithFaultyArgumentAreCompiled() { $string = '@for ($i = 0; $i < 10; $i++) test @continue(-2) @endfor'; $expected = '<?php for($i = 0; $i < 10; $i++): ?> test <?php continue 1; ?> <?php endfor; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } }