/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/View/Blade/BladeEnvironmentStatementsTest.php
66 строк
1 KB
jmills
[7.x] Update compileEnv() tests & param name (#33590)
20 июл 2020, 06:25
Не верифицирован
20 июл 2020, 06:25
eb37477
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\View\Blade; class BladeEnvironmentStatementsTest extends AbstractBladeTestCase { public function testEnvStatementsAreCompiled() { $string = "@env('staging') breeze @else boom @endenv"; $expected = "<?php if(app()->environment('staging')): ?> breeze <?php else: ?> boom <?php endif; ?>"; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testEnvStatementsWithMultipleStringParamsAreCompiled() { $string = "@env('staging', 'production') breeze @else boom @endenv"; $expected = "<?php if(app()->environment('staging', 'production')): ?> breeze <?php else: ?> boom <?php endif; ?>"; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testEnvStatementsWithArrayParamAreCompiled() { $string = "@env(['staging', 'production']) breeze @else boom @endenv"; $expected = "<?php if(app()->environment(['staging', 'production'])): ?> breeze <?php else: ?> boom <?php endif; ?>"; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testProductionStatementsAreCompiled() { $string = '@production breeze @else boom @endproduction'; $expected = "<?php if(app()->environment('production')): ?> breeze <?php else: ?> boom <?php endif; ?>"; $this->assertEquals($expected, $this->compiler->compileString($string)); } }