BladeIfAuthStatementsTest.php 673 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Illuminate\Tests\View\Blade;
  3. class BladeIfAuthStatementsTest extends AbstractBladeTestCase
  4. {
  5. public function testIfStatementsAreCompiled()
  6. {
  7. $string = '@auth("api")
  8. breeze
  9. @endauth';
  10. $expected = '<?php if(auth()->guard("api")->check()): ?>
  11. breeze
  12. <?php endif; ?>';
  13. $this->assertEquals($expected, $this->compiler->compileString($string));
  14. }
  15. public function testPlainIfStatementsAreCompiled()
  16. {
  17. $string = '@auth
  18. breeze
  19. @endauth';
  20. $expected = '<?php if(auth()->guard()->check()): ?>
  21. breeze
  22. <?php endif; ?>';
  23. $this->assertEquals($expected, $this->compiler->compileString($string));
  24. }
  25. }