Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Commit

Permalink
Remove ping method redifining (#4)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
andrew-nuwber authored Jul 13, 2021
1 parent 89c34ea commit 6739b5b
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 45 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build

on: [push]

jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0']
name: Testing on PHP ${{ matrix.php-versions }}
steps:
- uses: actions/checkout@v2
- name: setup
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: igbinary,redis
tools: composer

- name: start redis service
uses: supercharge/[email protected]

- name: install deps
run: composer install -o -q

- name: phpunit
run: ./vendor/bin/phpunit --coverage-clover ./coverage.xml

- name: upload coverage report
uses: codecov/codecov-action@v1
with:
file: './coverage.xml'
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ This extension provides the [redis](http://redis.io/) key-value store support fo

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

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

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

Expand Down
8 changes: 8 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
codecov:
token: ffaa516c-04a1-4cb7-960f-2e017dcc29f7
coverage:
status:
project:
default:
target: auto
threshold: 0.5
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"ext-json": "*",
"yiisoft/yii2": "~2.0.14",
"ext-redis": ">=3",
"php": ">=7.0"
"php": ">=7.2"
},
"autoload": {
"psr-4": {
Expand All @@ -26,7 +26,7 @@
}
},
"require-dev": {
"phpunit/phpunit": "<6.0",
"phpunit/phpunit": ">=8.0",
"yiisoft/yii2-redis": "^2.0"
},
"repositories": [
Expand Down
8 changes: 3 additions & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<file>./Cache.php</file>
<file>./Connection.php</file>
<file>./Session.php</file>
</whitelist>
<whitelist>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
8 changes: 0 additions & 8 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,6 @@ public function open( $host = null, $port = null, $timeout = null, $retry_interv
}
}

/**
* @return bool
*/
public function ping()
{
return parent::ping() === '+PONG';
}

public function flushdb($async = null)
{
return parent::flushDB();
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* This is the base class for all yii framework unit tests.
*/
abstract class TestCase extends \PHPUnit_Framework_TestCase
abstract class TestCase extends \PHPUnit\Framework\TestCase
{
public static $params;

Expand All @@ -35,7 +35,7 @@ public static function getParam()
* Clean up after test.
* By default the application created with [[mockApplication]] will be destroyed.
*/
protected function tearDown()
protected function tearDown(): void
{
parent::tearDown();
$this->destroyApplication();
Expand Down Expand Up @@ -81,7 +81,7 @@ protected function destroyApplication()
Yii::$container = new Container();
}

protected function setUp()
protected function setUp(): void
{
$params = self::getParam();
if ($params === null) {
Expand Down

0 comments on commit 6739b5b

Please sign in to comment.