BladeCommentsTest.php 755 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Illuminate\Tests\View\Blade;
  3. class BladeCommentsTest extends AbstractBladeTestCase
  4. {
  5. public function testCommentsAreCompiled()
  6. {
  7. $string = '{{--this is a comment--}}';
  8. $this->assertEmpty($this->compiler->compileString($string));
  9. $string = '{{--
  10. this is a comment
  11. --}}';
  12. $this->assertEmpty($this->compiler->compileString($string));
  13. $string = sprintf('{{-- this is an %s long comment --}}', str_repeat('extremely ', 1000));
  14. $this->assertEmpty($this->compiler->compileString($string));
  15. }
  16. public function testBladeCodeInsideCommentsIsNotCompiled()
  17. {
  18. $string = '{{-- @foreach() --}}';
  19. $this->assertEmpty($this->compiler->compileString($string));
  20. }
  21. }