/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/View/Blade/BladeInjectTest.php
34 строки
1 KB
Josip Crnković
wip (#36356)
23 фев 2021, 16:38
Не верифицирован
23 фев 2021, 16:38
11d7c7e
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\View\Blade; class BladeInjectTest extends AbstractBladeTestCase { public function testDependenciesInjectedAsStringsAreCompiled() { $string = "Foo @inject('baz', 'SomeNamespace\SomeClass') bar"; $expected = "Foo <?php \$baz = app('SomeNamespace\SomeClass'); ?> bar"; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testDependenciesInjectedAsStringsAreCompiledWhenInjectedWithDoubleQuotes() { $string = 'Foo @inject("baz", "SomeNamespace\SomeClass") bar'; $expected = 'Foo <?php $baz = app("SomeNamespace\SomeClass"); ?> bar'; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testDependenciesAreCompiled() { $string = "Foo @inject('baz', SomeNamespace\SomeClass::class) bar"; $expected = "Foo <?php \$baz = app(SomeNamespace\SomeClass::class); ?> bar"; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testDependenciesAreCompiledWithDoubleQuotes() { $string = 'Foo @inject("baz", SomeNamespace\SomeClass::class) bar'; $expected = "Foo <?php \$baz = app(SomeNamespace\SomeClass::class); ?> bar"; $this->assertEquals($expected, $this->compiler->compileString($string)); } }