Skip to content

Commit 2e067ac

Browse files
committed
Use GitHub actions for continuous integration (CI)
1 parent 271b800 commit 2e067ac

File tree

10 files changed

+47
-24
lines changed

10 files changed

+47
-24
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
PHPUnit:
9+
name: PHPUnit (PHP ${{ matrix.php }})
10+
runs-on: ubuntu-22.04
11+
strategy:
12+
matrix:
13+
php:
14+
- 5.4
15+
- 5.3
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: ${{ matrix.php }}
21+
coverage: xdebug
22+
- run: composer install
23+
- run: vendor/bin/phpunit --coverage-text

.travis.yml

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

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# clue/redis-protocol [![Build Status](https://travis-ci.org/clue/php-redis-protocol.png?branch=master)](https://travis-ci.org/clue/php-redis-protocol)
22

3+
[![CI status](https://github.com/clue/php-redis-protocol/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/php-redis-protocol/actions)
4+
[![installs on Packagist](https://img.shields.io/packagist/dt/clue/redis-protocol?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/clue/redis-protocol)
5+
36
A streaming redis protocol parser and serializer written in PHP
47

58
This parser and serializer implementation allows you to parse redis protocol

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
"require": {
1414
"php": ">=5.3"
1515
},
16+
"require-dev": {
17+
"phpunit/phpunit": "^4.8.36"
18+
},
1619
"autoload": {
17-
"psr-0": { "Clue\\Redis\\Protocol": "src" }
20+
"psr-0": {
21+
"Clue\\Redis\\Protocol": "src/"
22+
}
1823
}
1924
}

phpunit.xml.dist

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit bootstrap="tests/bootstrap.php"
4-
colors="true"
5-
convertErrorsToExceptions="true"
6-
convertNoticesToExceptions="true"
7-
convertWarningsToExceptions="true"
8-
>
3+
<!-- PHPUnit configuration file with old format for legacy PHPUnit -->
4+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd"
6+
bootstrap="vendor/autoload.php"
7+
colors="true">
98
<testsuites>
109
<testsuite name="Redis Protocol Test Suite">
1110
<directory>./tests/</directory>
@@ -16,4 +15,7 @@
1615
<directory>./src/</directory>
1716
</whitelist>
1817
</filter>
19-
</phpunit>
18+
<php>
19+
<ini name="error_reporting" value="-1" />
20+
</php>
21+
</phpunit>

tests/Model/AbstractModelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use Clue\Redis\Protocol\Serializer\RecursiveSerializer;
44

5-
abstract class AbstractModelTest extends TestCase
5+
abstract class AbstractModelTest extends \TestCase
66
{
77
protected $serializer;
88

tests/Parser/AbstractParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use Clue\Redis\Protocol\Parser\ParserInterface;
44
use Clue\Redis\Protocol\Parser\MessageBuffer;
55

6-
abstract class AbstractParserTest extends TestCase
6+
abstract class AbstractParserTest extends \TestCase
77
{
88
/**
99
*

tests/Parser/ResponseParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use Clue\Redis\Protocol\Parser\ResponseParser;
44

5-
class RecursiveParserTest extends AbstractParserTest
5+
class ResponseParserTest extends AbstractParserTest
66
{
77
protected function createParser()
88
{

tests/Serializer/AbstractSerializerTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?php
22

33
use Clue\Redis\Protocol\Serializer\SerializerInterface;
4-
use Clue\Redis\Protocol\Model\Status;
5-
use Clue\Redis\Protocol\Model\ErrorReplyException;
64
//use Exception;
75

8-
abstract class AbstractSerializerTest extends TestCase
6+
abstract class AbstractSerializerTest extends \TestCase
97
{
108
/**
119
* @return SerializerInterface
@@ -85,10 +83,10 @@ public function testArrayMultiBulkReply()
8583

8684
public function testErrorReply()
8785
{
88-
$model = $this->serializer->createReplyModel(new Exception('ERR failure'));
86+
$model = $this->serializer->createReplyModel(new \Exception('ERR failure'));
8987
$this->assertInstanceOf('Clue\Redis\Protocol\Model\ErrorReply', $model);
9088
$this->assertEquals('ERR failure', $model->getValueNative());
91-
$this->assertEquals($model->getMessageSerialized($this->serializer), $this->serializer->getReplyMessage(new Exception('ERR failure')));
89+
$this->assertEquals($model->getMessageSerialized($this->serializer), $this->serializer->getReplyMessage(new \Exception('ERR failure')));
9290
}
9391

9492
/**
File renamed without changes.

0 commit comments

Comments
 (0)