/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/View/Blade/BladeCananyStatementsTest.php
21 строка
675 B
Fu Xu
Add @canany and @elsecanany blade directive (#24137)
17 май 2018, 16:48
17 май 2018, 16:48
97edff8
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\View\Blade; class BladeCananyStatementsTest extends AbstractBladeTestCase { public function testCananyStatementsAreCompiled() { $string = '@canany ([\'create\', \'update\'], [$post]) breeze @elsecanany([\'delete\', \'approve\'], [$post]) sneeze @endcan'; $expected = '<?php if (app(\\Illuminate\\Contracts\\Auth\\Access\\Gate::class)->any([\'create\', \'update\'], [$post])): ?> breeze <?php elseif (app(\\Illuminate\\Contracts\\Auth\\Access\\Gate::class)->any([\'delete\', \'approve\'], [$post])): ?> sneeze <?php endif; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string)); } }