Skip to content

Commit

Permalink
Merge pull request #20 from howkey666/phpunit
Browse files Browse the repository at this point in the history
Make it compatible with PHP 7.2 and 7.3
  • Loading branch information
howkey666 authored Sep 16, 2019
2 parents a83215e + 30042b5 commit d9a3c96
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: php
php:
- 7.0
- 7.1
- hhvm
- 7.2
- 7.3
install:
- composer install --prefer-source --no-interaction
- wget http://download.redis.io/redis-stable.tar.gz && tar xzf redis-stable.tar.gz && cd redis-stable && make
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
}
],
"require": {
"php": ">=7.0.0",
"predis/predis": "~1.1.1"
"php": ">=7.1.0",
"predis/predis": "1.1.x-dev#157f658f0be5f48cb2aaa4b6a6ac753c1168f465"
},
"bin": [
"php-rq-run-tests"
],
"require-dev": {
"phpunit/phpunit": "~6.5.13",
"mockery/mockery": "~0.9.4",
"nette/finder": "~2.4"
"phpunit/phpunit": "~7.5.15",
"mockery/mockery": "~1.2.3",
"nette/finder": "~2.5"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function getItems($size)
$since = $this->time->now() - $this->options[self::OPT_PROCESS_TIME_OFFSET];
$chunk = $this->redis->poolGet($this->name, $size, $since, $this->options[self::OPT_ACK_TTL]);
$result = array_merge($result, $chunk);
if (count($chunk) < count($size)) {
if (count($chunk) < $size) {
break;
}
}
Expand Down
2 changes: 2 additions & 0 deletions tests/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ abstract class BaseTestCase extends \PHPUnit\Framework\TestCase
*/
public function __construct(ClientInterface $redis)
{
parent::__construct();

$this->redis = $redis;
}

Expand Down
7 changes: 6 additions & 1 deletion tests/TestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ public function run()
call_user_func_array([$testCase, $methodName], (array)$args);
}
} else {
$testCase = new $className($this->provider->getRedisClient());
if ($className === 'PhpRQ\\BaseTest') {
$testCase = new $className();
} else {
$testCase = new $className($this->provider->getRedisClient());
}

$testCase->$methodName();
}
}
Expand Down

0 comments on commit d9a3c96

Please sign in to comment.