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\Database; use Illuminate\Database\Console\Migrations\In..
Decoded Output download
<?php
namespace Illuminate\Tests\Database;
use Illuminate\Database\Console\Migrations\InstallCommand;
use Illuminate\Database\Migrations\MigrationRepositoryInterface;
use Illuminate\Foundation\Application;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
class DatabaseMigrationInstallCommandTest extends TestCase
{
protected function tearDown(): void
{
m::close();
}
public function testFireCallsRepositoryToInstall()
{
$command = new InstallCommand($repo = m::mock(MigrationRepositoryInterface::class));
$command->setLaravel(new Application);
$repo->shouldReceive('setSource')->once()->with('foo');
$repo->shouldReceive('createRepository')->once();
$this->runCommand($command, ['--database' => 'foo']);
}
protected function runCommand($command, $options = [])
{
return $command->run(new ArrayInput($options), new NullOutput);
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Illuminate\Tests\Database;
use Illuminate\Database\Console\Migrations\InstallCommand;
use Illuminate\Database\Migrations\MigrationRepositoryInterface;
use Illuminate\Foundation\Application;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
class DatabaseMigrationInstallCommandTest extends TestCase
{
protected function tearDown(): void
{
m::close();
}
public function testFireCallsRepositoryToInstall()
{
$command = new InstallCommand($repo = m::mock(MigrationRepositoryInterface::class));
$command->setLaravel(new Application);
$repo->shouldReceive('setSource')->once()->with('foo');
$repo->shouldReceive('createRepository')->once();
$this->runCommand($command, ['--database' => 'foo']);
}
protected function runCommand($command, $options = [])
{
return $command->run(new ArrayInput($options), new NullOutput);
}
}
Function Calls
None |
Stats
MD5 | 880337d3a409baa78192d3d4c59352e8 |
Eval Count | 0 |
Decode Time | 89 ms |