/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/View/Blade/BladePrependTest.php
50 строк
1 KB
Taylor Otwell
Revert "Use Str::uuid()->toString() instead of (string) casts (#60995)" (#61028)
04 авг 2026, 17:04
Не верифицирован
04 авг 2026, 17:04
68b8267
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\View\Blade; use Illuminate\Support\Str; class BladePrependTest extends AbstractBladeTestCase { public function testPrependIsCompiled() { $string = '@prepend(\'foo\') bar @endprepend'; $expected = '<?php $__env->startPrepend(\'foo\'); ?> bar <?php $__env->stopPrepend(); ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testPrependOnceIsCompiled() { $string = '@prependOnce(\'foo\', \'bar\') test @endPrependOnce'; $expected = '<?php if (! $__env->hasRenderedOnce(\'bar\')): $__env->markAsRenderedOnce(\'bar\'); $__env->startPrepend(\'foo\'); ?> test <?php $__env->stopPrepend(); endif; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } public function testPrependOnceIsCompiledWhenIdIsMissing() { Str::createUuidsUsing(fn () => 'e60e8f77-9ac3-4f71-9f8e-a044ef481d7f'); $string = '@prependOnce(\'foo\') test @endPrependOnce'; $expected = '<?php if (! $__env->hasRenderedOnce(\'e60e8f77-9ac3-4f71-9f8e-a044ef481d7f\')): $__env->markAsRenderedOnce(\'e60e8f77-9ac3-4f71-9f8e-a044ef481d7f\'); $__env->startPrepend(\'foo\'); ?> test <?php $__env->stopPrepend(); endif; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } }