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\Testing\Console; use Illuminate\Foundation\Console\Conf..
Decoded Output download
<?php
namespace Illuminate\Tests\Testing\Console;
use Illuminate\Foundation\Console\ConfigShowCommand;
use Orchestra\Testbench\TestCase;
class ConfigShowCommandTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
putenv('COLUMNS=64');
}
public function testDisplayConfig()
{
config()->set('test', [
'string' => 'Test',
'int' => 1,
'float' => 1.2,
'boolean' => true,
'null' => null,
'array' => [
ConfigShowCommand::class,
],
'empty_array' => [],
'assoc_array' => ['foo' => 'bar'],
'class' => new \stdClass,
]);
$this->artisan(ConfigShowCommand::class, ['config' => 'test'])
->assertSuccessful()
->expectsOutput(' test ....................................................... ')
->expectsOutput(' string ................................................ Test ')
->expectsOutput(' int ...................................................... 1 ')
->expectsOutput(' float .................................................. 1.2 ')
->expectsOutput(' boolean ............................................... true ')
->expectsOutput(' null .................................................. null ')
->expectsOutput(' array 0 .. Illuminate\Foundation\Console\ConfigShowCommand ')
->expectsOutput(' empty_array ............................................. [] ')
->expectsOutput(' assoc_array foo ...................................... bar ')
->expectsOutput(' class ............................................. stdClass ');
}
public function testDisplayNestedConfigItems()
{
config()->set('test', [
'nested' => [
'foo' => 'bar',
],
]);
$this->artisan(ConfigShowCommand::class, ['config' => 'test.nested'])
->assertSuccessful()
->expectsOutput(' test.nested ................................................ ')
->expectsOutput(' foo .................................................... bar ');
}
public function testDisplaySingleValue()
{
config()->set('foo', 'bar');
$this->artisan(ConfigShowCommand::class, ['config' => 'foo'])
->assertSuccessful()
->expectsOutput(' foo .................................................... bar ');
}
public function testDisplayErrorIfConfigDoesNotExist()
{
$this->artisan(ConfigShowCommand::class, ['config' => 'invalid'])
->assertFailed();
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Illuminate\Tests\Testing\Console;
use Illuminate\Foundation\Console\ConfigShowCommand;
use Orchestra\Testbench\TestCase;
class ConfigShowCommandTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
putenv('COLUMNS=64');
}
public function testDisplayConfig()
{
config()->set('test', [
'string' => 'Test',
'int' => 1,
'float' => 1.2,
'boolean' => true,
'null' => null,
'array' => [
ConfigShowCommand::class,
],
'empty_array' => [],
'assoc_array' => ['foo' => 'bar'],
'class' => new \stdClass,
]);
$this->artisan(ConfigShowCommand::class, ['config' => 'test'])
->assertSuccessful()
->expectsOutput(' test ....................................................... ')
->expectsOutput(' string ................................................ Test ')
->expectsOutput(' int ...................................................... 1 ')
->expectsOutput(' float .................................................. 1.2 ')
->expectsOutput(' boolean ............................................... true ')
->expectsOutput(' null .................................................. null ')
->expectsOutput(' array 0 .. Illuminate\Foundation\Console\ConfigShowCommand ')
->expectsOutput(' empty_array ............................................. [] ')
->expectsOutput(' assoc_array foo ...................................... bar ')
->expectsOutput(' class ............................................. stdClass ');
}
public function testDisplayNestedConfigItems()
{
config()->set('test', [
'nested' => [
'foo' => 'bar',
],
]);
$this->artisan(ConfigShowCommand::class, ['config' => 'test.nested'])
->assertSuccessful()
->expectsOutput(' test.nested ................................................ ')
->expectsOutput(' foo .................................................... bar ');
}
public function testDisplaySingleValue()
{
config()->set('foo', 'bar');
$this->artisan(ConfigShowCommand::class, ['config' => 'foo'])
->assertSuccessful()
->expectsOutput(' foo .................................................... bar ');
}
public function testDisplayErrorIfConfigDoesNotExist()
{
$this->artisan(ConfigShowCommand::class, ['config' => 'invalid'])
->assertFailed();
}
}
Function Calls
None |
Stats
MD5 | 505cbb3f61ac04ea5157af45513d497f |
Eval Count | 0 |
Decode Time | 125 ms |