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

Commit db89c28

Browse files
committed
added redis/rabbitmq tests
1 parent c4c9eff commit db89c28

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
language: php
22

3+
services:
4+
- redis-server
5+
- rabbitmq
6+
37
php:
48
- 5.3
59
- 5.3.3

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
"require-dev": {
2121
"zendframework/zend-loader" : "2.*",
2222
"sensiolabs/security-checker": "1.3.*@dev",
23-
"symfony/yaml": "v2.3.11",
23+
"symfony/yaml" : "v2.3.11",
2424
"guzzle/http" : "3.*",
25-
"guzzle/plugin-mock" : "3.*"
25+
"guzzle/plugin-mock" : "3.*",
26+
"videlalvaro/php-amqplib" : "2.*",
27+
"predis/predis" : "0.8.*"
2628
},
2729
"suggest" : {
2830
"ext-bcmath" : "Required by Check\\CpuPerformance",

tests/ZendDiagnosticsTest/ChecksTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
use ZendDiagnostics\Check\PhpFlag;
1616
use ZendDiagnostics\Check\PhpVersion;
1717
use ZendDiagnostics\Check\ProcessRunning;
18+
use ZendDiagnostics\Check\RabbitMQ;
19+
use ZendDiagnostics\Check\Redis;
1820
use ZendDiagnostics\Check\StreamWrapperExists;
1921
use ZendDiagnostics\Check\XmlFile;
2022
use ZendDiagnostics\Check\YamlFile;
@@ -43,6 +45,28 @@ public function testCpuPerformance()
4345
$this->assertInstanceOf('ZendDiagnostics\Result\Failure', $result);
4446
}
4547

48+
public function testRabbitMQ()
49+
{
50+
$check = new RabbitMQ();
51+
$result = $check->check();
52+
$this->assertInstanceOf('ZendDiagnostics\Result\Success', $result);
53+
54+
$check = new RabbitMQ('example.com');
55+
$result = $check->check();
56+
$this->assertInstanceOf('ZendDiagnostics\Result\Failure', $result);
57+
}
58+
59+
public function testRedis()
60+
{
61+
$check = new Redis();
62+
$result = $check->check();
63+
$this->assertInstanceOf('ZendDiagnostics\Result\Success', $result);
64+
65+
$check = new Redis('example.com');
66+
$result = $check->check();
67+
$this->assertInstanceOf('ZendDiagnostics\Result\Failure', $result);
68+
}
69+
4670
public function testClassExists()
4771
{
4872
$check = new ClassExists(__CLASS__);

0 commit comments

Comments
 (0)