소스 검색

Fix Redis test failures

Jordi Boggiano 9 년 전
부모
커밋
b21b465cca
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      tests/Monolog/Handler/RedisHandlerTest.php

+ 12 - 0
tests/Monolog/Handler/RedisHandlerTest.php

@@ -33,6 +33,10 @@ class RedisHandlerTest extends TestCase
 
     public function testConstructorShouldWorkWithRedis()
     {
+        if (!class_exists('Redis')) {
+            $this->markTestSkipped('The redis ext is required to run this test');
+        }
+
         $redis = $this->createMock('Redis');
         $this->assertInstanceof('Monolog\Handler\RedisHandler', new RedisHandler($redis, 'key'));
     }
@@ -55,6 +59,10 @@ class RedisHandlerTest extends TestCase
 
     public function testRedisHandle()
     {
+        if (!class_exists('Redis')) {
+            $this->markTestSkipped('The redis ext is required to run this test');
+        }
+
         $redis = $this->createPartialMock('Redis', ['rpush']);
 
         // Redis uses rPush
@@ -71,6 +79,10 @@ class RedisHandlerTest extends TestCase
 
     public function testRedisHandleCapped()
     {
+        if (!class_exists('Redis')) {
+            $this->markTestSkipped('The redis ext is required to run this test');
+        }
+
         $redis = $this->createPartialMock('Redis', ['multi', 'rpush', 'ltrim', 'exec']);
 
         // Redis uses multi