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 declare(strict_types=1); namespace Illuminate\Tests\Integration\Generators; class..
Decoded Output download
<?php
declare(strict_types=1);
namespace Illuminate\Tests\Integration\Generators;
class TraitMakeCommandTest extends TestCase
{
public function testItCanGenerateTraitFile()
{
$this->artisan('make:trait', ['name' => 'FooTrait'])
->assertExitCode(0);
$this->assertFileContains([
'namespace App;',
'trait FooTrait',
], 'app/FooTrait.php');
}
public function testItCanGenerateTraitFileWhenTraitsFolderExists()
{
$traitsFolderPath = app_path('Traits');
/** @var \Illuminate\Filesystem\Filesystem $files */
$files = $this->app['files'];
$files->ensureDirectoryExists($traitsFolderPath);
$this->artisan('make:trait', ['name' => 'FooTrait'])
->assertExitCode(0);
$this->assertFileContains([
'namespace App\Traits;',
'trait FooTrait',
], 'app/Traits/FooTrait.php');
$files->deleteDirectory($traitsFolderPath);
}
public function testItCanGenerateTraitFileWhenConcernsFolderExists()
{
$traitsFolderPath = app_path('Concerns');
/** @var \Illuminate\Filesystem\Filesystem $files */
$files = $this->app['files'];
$files->ensureDirectoryExists($traitsFolderPath);
$this->artisan('make:trait', ['name' => 'FooTrait'])
->assertExitCode(0);
$this->assertFileContains([
'namespace App\Concerns;',
'trait FooTrait',
], 'app/Concerns/FooTrait.php');
$files->deleteDirectory($traitsFolderPath);
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare(strict_types=1);
namespace Illuminate\Tests\Integration\Generators;
class TraitMakeCommandTest extends TestCase
{
public function testItCanGenerateTraitFile()
{
$this->artisan('make:trait', ['name' => 'FooTrait'])
->assertExitCode(0);
$this->assertFileContains([
'namespace App;',
'trait FooTrait',
], 'app/FooTrait.php');
}
public function testItCanGenerateTraitFileWhenTraitsFolderExists()
{
$traitsFolderPath = app_path('Traits');
/** @var \Illuminate\Filesystem\Filesystem $files */
$files = $this->app['files'];
$files->ensureDirectoryExists($traitsFolderPath);
$this->artisan('make:trait', ['name' => 'FooTrait'])
->assertExitCode(0);
$this->assertFileContains([
'namespace App\Traits;',
'trait FooTrait',
], 'app/Traits/FooTrait.php');
$files->deleteDirectory($traitsFolderPath);
}
public function testItCanGenerateTraitFileWhenConcernsFolderExists()
{
$traitsFolderPath = app_path('Concerns');
/** @var \Illuminate\Filesystem\Filesystem $files */
$files = $this->app['files'];
$files->ensureDirectoryExists($traitsFolderPath);
$this->artisan('make:trait', ['name' => 'FooTrait'])
->assertExitCode(0);
$this->assertFileContains([
'namespace App\Concerns;',
'trait FooTrait',
], 'app/Concerns/FooTrait.php');
$files->deleteDirectory($traitsFolderPath);
}
}
Function Calls
| None |
Stats
| MD5 | ca430eb2e00afc62b88b7fd5256b89ae |
| Eval Count | 0 |
| Decode Time | 92 ms |