diff --git a/.travis.yml b/.travis.yml index 80b64a5..96ba9fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: php php: + - 5.5 - 5.6 - 7.0 - 7.1 diff --git a/tests/CredisClusterTest.php b/tests/CredisClusterTest.php index 7059928..c72d629 100644 --- a/tests/CredisClusterTest.php +++ b/tests/CredisClusterTest.php @@ -92,7 +92,7 @@ public function testMasterSlave() $this->waitForSlaveReplication(); $this->assertEquals('value',$this->cluster->client('slave')->get('key')); $this->assertEquals('value',$this->cluster->get('key')); - $this->expectException('CredisException','read-only slaves should not be writeable'); + $this->expectException('CredisException'); $this->assertFalse($this->cluster->client('slave')->set('key2','value')); } public function testMasterWithoutSlavesAndWriteOnlyFlag() diff --git a/tests/CredisTestCommon.php b/tests/CredisTestCommon.php index 8c64371..b50e11a 100644 --- a/tests/CredisTestCommon.php +++ b/tests/CredisTestCommon.php @@ -1,7 +1,7 @@ getMock($class); + } else { + return parent::createMock($class); + } + } + + /** + * Polyfill for older PHPUnit + */ + public function expectException($class, $message = NULL, $code = NULL) + { + if (method_exists($this, 'setExpectedException')) { + $this->setExpectedException($class, $message, $code); + } else { + parent::expectException($class); + if ($message !== null) { + $this->expectExceptionMessage($message); + } + if ($code !== null) { + $this->expectExceptionCode($code); + } + } + } }