Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace Illuminate\Tests\View\Blade; class BladeJsTest extends AbstractBladeTest..
Decoded Output download
<?php
namespace Illuminate\Tests\View\Blade;
class BladeJsTest extends AbstractBladeTestCase
{
public function testStatementIsCompiledWithoutAnyOptions()
{
$string = '<div x-data="@js($data)"></div>';
$expected = '<div x-data="<?php echo \Illuminate\Support\Js::from($data)->toHtml() ?>"></div>';
$this->assertEquals($expected, $this->compiler->compileString($string));
}
public function testJsonFlagsCanBeSet()
{
$string = '<div x-data="@js($data, JSON_FORCE_OBJECT)"></div>';
$expected = '<div x-data="<?php echo \Illuminate\Support\Js::from($data, JSON_FORCE_OBJECT)->toHtml() ?>"></div>';
$this->assertEquals($expected, $this->compiler->compileString($string));
}
public function testEncodingDepthCanBeSet()
{
$string = '<div x-data="@js($data, JSON_FORCE_OBJECT, 256)"></div>';
$expected = '<div x-data="<?php echo \Illuminate\Support\Js::from($data, JSON_FORCE_OBJECT, 256)->toHtml() ?>"></div>';
$this->assertEquals($expected, $this->compiler->compileString($string));
}
}
Did this file decode correctly?
Original Code
<?php
namespace Illuminate\Tests\View\Blade;
class BladeJsTest extends AbstractBladeTestCase
{
public function testStatementIsCompiledWithoutAnyOptions()
{
$string = '<div x-data="@js($data)"></div>';
$expected = '<div x-data="<?php echo \Illuminate\Support\Js::from($data)->toHtml() ?>"></div>';
$this->assertEquals($expected, $this->compiler->compileString($string));
}
public function testJsonFlagsCanBeSet()
{
$string = '<div x-data="@js($data, JSON_FORCE_OBJECT)"></div>';
$expected = '<div x-data="<?php echo \Illuminate\Support\Js::from($data, JSON_FORCE_OBJECT)->toHtml() ?>"></div>';
$this->assertEquals($expected, $this->compiler->compileString($string));
}
public function testEncodingDepthCanBeSet()
{
$string = '<div x-data="@js($data, JSON_FORCE_OBJECT, 256)"></div>';
$expected = '<div x-data="<?php echo \Illuminate\Support\Js::from($data, JSON_FORCE_OBJECT, 256)->toHtml() ?>"></div>';
$this->assertEquals($expected, $this->compiler->compileString($string));
}
}
Function Calls
| None |
Stats
| MD5 | 69c425e69be0d7e7bf49196e6dc638fb |
| Eval Count | 0 |
| Decode Time | 88 ms |