Ver código fonte

Merge remote-tracking branch 'github/pr/393' into v1.1

Daniele Alessandri 8 anos atrás
pai
commit
944a16d7c0
2 arquivos alterados com 21 adições e 1 exclusões
  1. 1 0
      .travis.yml
  2. 20 1
      tests/Predis/Command/RawCommandTest.php

+ 1 - 0
.travis.yml

@@ -6,6 +6,7 @@ php:
   - 5.5
   - 5.6
   - 7.0
+  - 7.1
   - hhvm
 branches:
   except:

+ 20 - 1
tests/Predis/Command/RawCommandTest.php

@@ -74,10 +74,29 @@ class RawCommandTest extends PredisTestCase
      * argument is missing, PHP emits an E_WARNING.
      *
      * @group disconnected
-     * @expectedException \PHPUnit_Framework_Error_Warning
      */
     public function testPHPWarningOnMissingCommandIDWithStaticCreate()
     {
+        if (version_compare(PHP_VERSION, "7.1", '>')) {
+            $this->markTestSkipped('only for PHP < 7.1');
+        }
+        $this->setExpectedException('PHPUnit_Framework_Error_Warning');
+        RawCommand::create();
+    }
+
+    /**
+     * The signature of RawCommand::create() requires one argument which is the
+     * ID of the command (other arguments are fetched dinamically). If the first
+     * argument is missing, PHP 7.1 throw an exception
+     *
+     * @group disconnected
+     */
+    public function testPHPWarningOnMissingCommandIDWithStaticCreate71()
+    {
+        if (version_compare(PHP_VERSION, "7.1", '<')) {
+            $this->markTestSkipped('only for PHP > 7.1');
+        }
+        $this->setExpectedException('ArgumentCountError');
         RawCommand::create();
     }