Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 0a9b7c8

Browse files
committed
adjusted tests and checks
1 parent db89c28 commit 0a9b7c8

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

src/ZendDiagnostics/Check/RabbitMQ.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function __construct(
7070
*/
7171
public function check()
7272
{
73-
if (!class_exists('PhpAmqpLib\Connection\AMQPConnection', false)) {
73+
if (!class_exists('PhpAmqpLib\Connection\AMQPConnection')) {
7474
return new Failure('PhpAmqpLib is not installed');
7575
}
7676

src/ZendDiagnostics/Check/Redis.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace ZendDiagnostics\Check;
77

88
use Predis\Client;
9+
use Predis\PredisException;
910
use ZendDiagnostics\Result\Failure;
1011
use ZendDiagnostics\Result\Success;
1112

@@ -44,7 +45,7 @@ public function __construct($host = 'localhost', $port = 6379)
4445
*/
4546
public function check()
4647
{
47-
if (!class_exists('Predis\Client', false)) {
48+
if (!class_exists('Predis\Client')) {
4849
return new Failure('Predis is not installed');
4950
}
5051

@@ -53,15 +54,7 @@ public function check()
5354
'port' => $this->port,
5455
));
5556

56-
if (!$client->ping()) {
57-
return new Failure(
58-
sprintf(
59-
'No Redis server running at host %s on port %s',
60-
$this->host,
61-
$this->port
62-
)
63-
);
64-
}
57+
$client->ping();
6558

6659
return new Success();
6760
}

tests/ZendDiagnosticsTest/ChecksTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,13 @@ public function testRabbitMQ()
5050
$check = new RabbitMQ();
5151
$result = $check->check();
5252
$this->assertInstanceOf('ZendDiagnostics\Result\Success', $result);
53-
54-
$check = new RabbitMQ('example.com');
55-
$result = $check->check();
56-
$this->assertInstanceOf('ZendDiagnostics\Result\Failure', $result);
5753
}
5854

5955
public function testRedis()
6056
{
6157
$check = new Redis();
6258
$result = $check->check();
6359
$this->assertInstanceOf('ZendDiagnostics\Result\Success', $result);
64-
65-
$check = new Redis('example.com');
66-
$result = $check->check();
67-
$this->assertInstanceOf('ZendDiagnostics\Result\Failure', $result);
6860
}
6961

7062
public function testClassExists()

0 commit comments

Comments
 (0)