Jordi Boggiano 3 лет назад
Родитель
Сommit
acc142c2b7

+ 0 - 1
composer.json

@@ -27,7 +27,6 @@
         "mongodb/mongodb": "^1.8",
         "php-amqplib/php-amqplib": "~2.4 || ^3",
         "php-console/php-console": "^3.1.3",
-        "phpspec/prophecy": "^1.15",
         "phpstan/phpstan": "^1.4",
         "phpstan/phpstan-deprecation-rules": "^1.0",
         "phpstan/phpstan-strict-rules": "^1.1",

+ 4 - 3
tests/Monolog/Handler/RedisHandlerTest.php

@@ -35,9 +35,10 @@ class RedisHandlerTest extends TestCase
 
     public function testPredisHandle()
     {
-        $redis = $this->prophesize('Predis\Client');
-        $redis->rpush('key', 'test')->shouldBeCalled();
-        $redis = $redis->reveal();
+        $redis = $this->getMockBuilder('Predis\Client')->getMock();
+        $redis->expects($this->atLeastOnce())
+            ->method('__call')
+            ->with(self::equalTo('rpush'), self::equalTo(['key', 'test']));
 
         $record = $this->getRecord(Level::Warning, 'test', ['data' => new \stdClass, 'foo' => 34]);
 

+ 4 - 3
tests/Monolog/Handler/RedisPubSubHandlerTest.php

@@ -37,9 +37,10 @@ class RedisPubSubHandlerTest extends TestCase
 
     public function testPredisHandle()
     {
-        $redis = $this->prophesize('Predis\Client');
-        $redis->publish('key', 'test')->shouldBeCalled();
-        $redis = $redis->reveal();
+        $redis = $this->getMockBuilder('Predis\Client')->getMock();
+        $redis->expects($this->atLeastOnce())
+            ->method('__call')
+            ->with(self::equalTo('publish'), self::equalTo(['key', 'test']));
 
         $record = $this->getRecord(Level::Warning, 'test', ['data' => new \stdClass(), 'foo' => 34]);