BladeExpressionTest.php 886 B

123456789101112131415161718
  1. <?php
  2. namespace Illuminate\Tests\View\Blade;
  3. class BladeExpressionTest extends AbstractBladeTestCase
  4. {
  5. public function testExpressionsOnTheSameLine()
  6. {
  7. $this->assertSame('<?php echo app(\'translator\')->get(foo(bar(baz(qux(breeze()))))); ?> space () <?php echo app(\'translator\')->get(foo(bar)); ?>', $this->compiler->compileString('@lang(foo(bar(baz(qux(breeze()))))) space () @lang(foo(bar))'));
  8. }
  9. public function testExpressionWithinHTML()
  10. {
  11. $this->assertSame('<html <?php echo e($foo); ?>>', $this->compiler->compileString('<html {{ $foo }}>'));
  12. $this->assertSame('<html<?php echo e($foo); ?>>', $this->compiler->compileString('<html{{ $foo }}>'));
  13. $this->assertSame('<html <?php echo e($foo); ?> <?php echo app(\'translator\')->get(\'foo\'); ?>>', $this->compiler->compileString('<html {{ $foo }} @lang(\'foo\')>'));
  14. }
  15. }