Skip to content

Commit

Permalink
Merge pull request #15 from generationtux/fix-queue-db-desc-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Olofguard authored Sep 15, 2020
2 parents 00984b4 + cc3e11f commit b533791
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
8 changes: 1 addition & 7 deletions src/Checks/Laravel/DatabaseHealthCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ public function setConnection($connection): void
*/
public function description(): string
{
$description = $this->description;

if (!$description) {
$description = $this->connection() ?: 'default';
}

return $description;
return $this->connection() ?: $this->description;;
}
}
4 changes: 1 addition & 3 deletions src/Checks/Laravel/QueueHealthCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ public function setName($name): void
*/
public function description(): ?string
{
$description = $this->description ?: $this->name();

return $description;
return $this->name() ?: $this->description;
}
}
2 changes: 1 addition & 1 deletion tests/Checks/Laravel/DatabaseHealthCheckTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function sets_connection_name()
}

/** @test */
public function if_no_description_is_set_use_the_connection_name()
public function if_no_connection_is_set_use_the_description()
{
$description = $this->db->description();
$this->assertSame('Check the database connection.', $description); # if connection is also null
Expand Down
4 changes: 2 additions & 2 deletions tests/Checks/Laravel/QueueHealthCheckTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ public function sets_queue_name()
}

/** @test */
public function if_no_description_is_set_use_the_connection_name()
public function if_no_connection_is_set_use_the_description()
{
$description = $this->queue->description();
$this->assertNull($description);
$this->assertSame('Check the queue connection.', $description);

$this->queue->setName('sqs');
$description = $this->queue->description();
Expand Down

0 comments on commit b533791

Please sign in to comment.