Moved locking logic for CLI commands to a common abstract class

This commit is contained in:
Alejandro Celaya
2019-08-04 11:16:46 +02:00
parent 94e1e6a7b6
commit 7ed85e8916
7 changed files with 128 additions and 74 deletions

View File

@@ -25,14 +25,7 @@ class ApplicationFactoryTest extends TestCase
}
/** @test */
public function serviceIsCreated()
{
$instance = ($this->factory)($this->createServiceManager(), '');
$this->assertInstanceOf(Application::class, $instance);
}
/** @test */
public function allCommandsWhichAreServicesAreAdded()
public function allCommandsWhichAreServicesAreAdded(): void
{
$sm = $this->createServiceManager([
'commands' => [
@@ -45,8 +38,7 @@ class ApplicationFactoryTest extends TestCase
$sm->setService('bar', $this->createCommandMock('bar')->reveal());
/** @var Application $instance */
$instance = ($this->factory)($sm, '');
$this->assertInstanceOf(Application::class, $instance);
$instance = ($this->factory)($sm);
$this->assertTrue($instance->has('foo'));
$this->assertTrue($instance->has('bar'));