From bb251a1b56b847a22eca774b8c996f7343183a97 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Sun, 15 Dec 2019 20:25:41 +0800 Subject: [PATCH] Finish memory to save value to db and refresh cache if needed. #9 Signed-off-by: Mior Muhammad Zaki --- src/Console/ConfigureMailCommand.php | 2 ++ tests/Feature/Console/ConfigureMailCommandTest.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Console/ConfigureMailCommand.php b/src/Console/ConfigureMailCommand.php index 06e1db1..4527928 100644 --- a/src/Console/ConfigureMailCommand.php +++ b/src/Console/ConfigureMailCommand.php @@ -38,6 +38,8 @@ public function handle(Foundation $foundation) $updater($name, $email); }); + $memory->finish(); + return 0; } } diff --git a/tests/Feature/Console/ConfigureMailCommandTest.php b/tests/Feature/Console/ConfigureMailCommandTest.php index 8fd4ed7..0e36b05 100644 --- a/tests/Feature/Console/ConfigureMailCommandTest.php +++ b/tests/Feature/Console/ConfigureMailCommandTest.php @@ -34,7 +34,8 @@ public function it_cant_sync_configuration_when_orchestra_is_installed() $memory->shouldReceive('get')->once()->with('email.from.name')->andReturn('Orchestra Platform') ->shouldReceive('get')->once()->with('email.from.address')->andReturn('hello@orchestraplatform.com') ->shouldReceive('put')->once()->with('email', ['driver' => 'smtp', 'host' => 'smtp.mailgun.org', 'port' => 587, 'encryption' => 'tls', 'sendmail' => '/usr/sbin/sendmail -bs'])->andReturnNull() - ->shouldReceive('put')->once()->with('email.from', ['name' => 'The Application', 'address' => 'crynobone@gmail.com'])->andReturnNull(); + ->shouldReceive('put')->once()->with('email.from', ['name' => 'The Application', 'address' => 'crynobone@gmail.com'])->andReturnNull() + ->shouldReceive('finish')->once()->andReturn(true); $this->artisan('orchestra:configure-email') ->expectsQuestion('What is the application name?', 'The Application')