From 2633a5d05011dac70f90ca752d1fda950c3f7c88 Mon Sep 17 00:00:00 2001 From: huangzhhui Date: Fri, 31 May 2019 02:37:50 +0800 Subject: [PATCH] Format --- .../DatabaseMigrationMigrateCommandTest.php | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/database/tests/DatabaseMigrationMigrateCommandTest.php b/src/database/tests/DatabaseMigrationMigrateCommandTest.php index 699d40d92..79cdcf0b7 100755 --- a/src/database/tests/DatabaseMigrationMigrateCommandTest.php +++ b/src/database/tests/DatabaseMigrationMigrateCommandTest.php @@ -1,15 +1,29 @@ shouldReceive('paths')->once()->andReturn([]); $migrator->shouldReceive('setConnection')->once()->with('default'); $migrator->shouldReceive('setOutput')->once()->andReturn($migrator); - $migrator->shouldReceive('run')->once()->with([__DIR__.DIRECTORY_SEPARATOR.'migrations'], ['pretend' => false, 'step' => false]); + $migrator->shouldReceive('run')->once()->with([__DIR__ . DIRECTORY_SEPARATOR . 'migrations'], ['pretend' => false, 'step' => false]); $migrator->shouldReceive('getNotes')->andReturn([]); $migrator->shouldReceive('repositoryExists')->once()->andReturn(true); @@ -46,7 +59,7 @@ class DatabaseMigrationMigrateCommandTest extends TestCase $migrator->shouldReceive('paths')->once()->andReturn([]); $migrator->shouldReceive('setConnection')->once()->with('default'); $migrator->shouldReceive('setOutput')->once()->andReturn($migrator); - $migrator->shouldReceive('run')->once()->with([__DIR__.DIRECTORY_SEPARATOR.'migrations'], ['pretend' => false, 'step' => false]); + $migrator->shouldReceive('run')->once()->with([__DIR__ . DIRECTORY_SEPARATOR . 'migrations'], ['pretend' => false, 'step' => false]); $migrator->shouldReceive('repositoryExists')->once()->andReturn(false); $command->expects($this->once())->method('call')->with($this->equalTo('migrate:install'), $this->equalTo([])); @@ -59,7 +72,7 @@ class DatabaseMigrationMigrateCommandTest extends TestCase $migrator->shouldReceive('paths')->once()->andReturn([]); $migrator->shouldReceive('setConnection')->once()->with('default'); $migrator->shouldReceive('setOutput')->once()->andReturn($migrator); - $migrator->shouldReceive('run')->once()->with([__DIR__.DIRECTORY_SEPARATOR.'migrations'], ['pretend' => true, 'step' => false]); + $migrator->shouldReceive('run')->once()->with([__DIR__ . DIRECTORY_SEPARATOR . 'migrations'], ['pretend' => true, 'step' => false]); $migrator->shouldReceive('repositoryExists')->once()->andReturn(true); $this->runCommand($command, ['--pretend' => true]); @@ -71,7 +84,7 @@ class DatabaseMigrationMigrateCommandTest extends TestCase $migrator->shouldReceive('paths')->once()->andReturn([]); $migrator->shouldReceive('setConnection')->once()->with('foo'); $migrator->shouldReceive('setOutput')->once()->andReturn($migrator); - $migrator->shouldReceive('run')->once()->with([__DIR__.DIRECTORY_SEPARATOR.'migrations'], ['pretend' => false, 'step' => false]); + $migrator->shouldReceive('run')->once()->with([__DIR__ . DIRECTORY_SEPARATOR . 'migrations'], ['pretend' => false, 'step' => false]); $migrator->shouldReceive('repositoryExists')->once()->andReturn(true); $this->runCommand($command, ['--database' => 'foo']); @@ -83,7 +96,7 @@ class DatabaseMigrationMigrateCommandTest extends TestCase $migrator->shouldReceive('paths')->once()->andReturn([]); $migrator->shouldReceive('setConnection')->once()->with('default'); $migrator->shouldReceive('setOutput')->once()->andReturn($migrator); - $migrator->shouldReceive('run')->once()->with([__DIR__.DIRECTORY_SEPARATOR.'migrations'], ['pretend' => false, 'step' => true]); + $migrator->shouldReceive('run')->once()->with([__DIR__ . DIRECTORY_SEPARATOR . 'migrations'], ['pretend' => false, 'step' => true]); $migrator->shouldReceive('repositoryExists')->once()->andReturn(true); $this->runCommand($command, ['--step' => true]); @@ -91,7 +104,7 @@ class DatabaseMigrationMigrateCommandTest extends TestCase protected function runCommand($command, $input = []) { - return $command->run(new ArrayInput($input), new NullOutput); + return $command->run(new ArrayInput($input), new NullOutput()); } } @@ -106,7 +119,7 @@ class ApplicationDatabaseMigrationStub { $this->container = Mockery::mock(ContainerInterface::class); foreach ($data as $abstract => $instance) { - $this->container->shouldReceive('get')->with($abstract)->andReturn(class_exists($instance) ? new $instance : $instance); + $this->container->shouldReceive('get')->with($abstract)->andReturn(class_exists($instance) ? new $instance() : $instance); } }