Skip to content

Commit 6739b5b

Browse files
Remove ping method redifining (#4)
* remove ping method redifining * add more php versions to ci * use github actions * add redis to ci * update phpunit, remove old php versions * more ci fixes * add badges
1 parent 89c34ea commit 6739b5b

File tree

8 files changed

+51
-45
lines changed

8 files changed

+51
-45
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build
2+
3+
on: [push]
4+
5+
jobs:
6+
run:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
php-versions: ['7.2', '7.3', '7.4', '8.0']
11+
name: Testing on PHP ${{ matrix.php-versions }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: setup
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: ${{ matrix.php-versions }}
18+
extensions: igbinary,redis
19+
tools: composer
20+
21+
- name: start redis service
22+
uses: supercharge/redis-github-action@1.2.0
23+
24+
- name: install deps
25+
run: composer install -o -q
26+
27+
- name: phpunit
28+
run: ./vendor/bin/phpunit --coverage-clover ./coverage.xml
29+
30+
- name: upload coverage report
31+
uses: codecov/codecov-action@v1
32+
with:
33+
file: './coverage.xml'

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ This extension provides the [redis](http://redis.io/) key-value store support fo
44

55
It includes a `Cache` and `Session` storage handler in redis.
66

7-
[![Build Status](https://travis-ci.org/nuwber/yii2-phpredis.svg?branch=master)](https://travis-ci.org/nuwber/yii2-phpredis)
7+
[![Build](https://github.com/nuwber/yii2-phpredis/actions/workflows/build.yml/badge.svg)](https://github.com/nuwber/yii2-phpredis/actions/workflows/build.yml)
8+
[![codecov](https://codecov.io/gh/nuwber/yii2-phpredis/branch/master/graph/badge.svg?token=87YQF09NJ4)](https://codecov.io/gh/nuwber/yii2-phpredis)
89

910
**Notice: THIS REPO DOES NOT SUPPORT ACTIVE RECORD.**
1011

codecov.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
codecov:
2+
token: ffaa516c-04a1-4cb7-960f-2e017dcc29f7
3+
coverage:
4+
status:
5+
project:
6+
default:
7+
target: auto
8+
threshold: 0.5

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"ext-json": "*",
1818
"yiisoft/yii2": "~2.0.14",
1919
"ext-redis": ">=3",
20-
"php": ">=7.0"
20+
"php": ">=7.2"
2121
},
2222
"autoload": {
2323
"psr-4": {
@@ -26,7 +26,7 @@
2626
}
2727
},
2828
"require-dev": {
29-
"phpunit/phpunit": "<6.0",
29+
"phpunit/phpunit": ">=8.0",
3030
"yiisoft/yii2-redis": "^2.0"
3131
},
3232
"repositories": [

phpunit.xml.dist

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
</testsuite>
1212
</testsuites>
1313
<filter>
14-
<whitelist>
15-
<file>./Cache.php</file>
16-
<file>./Connection.php</file>
17-
<file>./Session.php</file>
18-
</whitelist>
14+
<whitelist>
15+
<directory suffix=".php">./src</directory>
16+
</whitelist>
1917
</filter>
2018
</phpunit>

src/Connection.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,6 @@ public function open( $host = null, $port = null, $timeout = null, $retry_interv
106106
}
107107
}
108108

109-
/**
110-
* @return bool
111-
*/
112-
public function ping()
113-
{
114-
return parent::ping() === '+PONG';
115-
}
116-
117109
public function flushdb($async = null)
118110
{
119111
return parent::flushDB();

tests/TestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* This is the base class for all yii framework unit tests.
1212
*/
13-
abstract class TestCase extends \PHPUnit_Framework_TestCase
13+
abstract class TestCase extends \PHPUnit\Framework\TestCase
1414
{
1515
public static $params;
1616

@@ -35,7 +35,7 @@ public static function getParam()
3535
* Clean up after test.
3636
* By default the application created with [[mockApplication]] will be destroyed.
3737
*/
38-
protected function tearDown()
38+
protected function tearDown(): void
3939
{
4040
parent::tearDown();
4141
$this->destroyApplication();
@@ -81,7 +81,7 @@ protected function destroyApplication()
8181
Yii::$container = new Container();
8282
}
8383

84-
protected function setUp()
84+
protected function setUp(): void
8585
{
8686
$params = self::getParam();
8787
if ($params === null) {

0 commit comments

Comments
 (0)