Skip to content

Commit

Permalink
Hide calling temporarily disabled from config output. Edited CallsDow…
Browse files Browse the repository at this point in the history
…nCommand.php to not check if already temporarily disabled. We just reset the cache key and continue on.
  • Loading branch information
RTippin committed Jul 18, 2021
1 parent 303e12d commit 44b768a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/Commands/CallsDownCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public function handle(Messenger $messenger): void
{
if (! $messenger->isCallingEnabled()) {
$this->info('Call system currently disabled.');
} elseif ($messenger->isCallingTemporarilyDisabled()) {
$this->info('Call system is already shutdown.');
} else {
$messenger->disableCallsTemporarily($this->option('duration'));

Expand Down
1 change: 1 addition & 0 deletions src/MessengerConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ trait MessengerConfig
'providerCanSearch',
'providerCanFriend',
'providerCanMessageFirst',
'callingTemporarilyDisabled',
'providerHasDevices',
'defaultNotFoundImage',
'defaultGhostAvatar',
Expand Down
7 changes: 3 additions & 4 deletions tests/Commands/CallsDownCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ public function it_does_nothing_if_calling_disabled()
}

/** @test */
public function it_does_nothing_if_calling_already_down()
public function it_sets_down_again_if_already_down()
{
Messenger::disableCallsTemporarily(1);

$this->artisan('messenger:calls:down')
->expectsOutput('Call system is already shutdown.')
->expectsOutput('No active calls to end found.')
->expectsOutput('Call system is now down for 30 minutes.')
->assertExitCode(0);

$this->assertTrue(Cache::has('messenger:calls:down'));
Expand Down

0 comments on commit 44b768a

Please sign in to comment.