diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4cc0a9b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + pull_request: + +jobs: + PHPUnit: + name: PHPUnit (PHP ${{ matrix.php }}) + runs-on: ubuntu-22.04 + strategy: + matrix: + php: + - 5.4 + - 5.3 + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + ini-file: development + - run: composer install + - run: vendor/bin/phpunit --coverage-text diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2af5cf5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: php -php: - - 5.4 - - 5.3 -before_script: - - composer install --dev --prefer-source --no-interaction -script: - - phpunit --coverage-text diff --git a/README.md b/README.md index ea36a67..7713acb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # clue/redis-protocol [![Build Status](https://travis-ci.org/clue/php-redis-protocol.png?branch=master)](https://travis-ci.org/clue/php-redis-protocol) +[![CI status](https://github.com/clue/php-redis-protocol/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/php-redis-protocol/actions) + A streaming redis protocol parser and serializer written in PHP This parser and serializer implementation allows you to parse redis protocol diff --git a/composer.json b/composer.json index d99e2ee..eef3ef1 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,17 @@ "require": { "php": ">=5.3" }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, "autoload": { - "psr-0": { "Clue\\Redis\\Protocol": "src" } + "psr-4": { + "Clue\\Redis\\Protocol\\": "src/Clue/Redis/Protocol/" + } + }, + "autoload-dev": { + "psr-4": { + "Clue\\Tests\\Redis\\Protocol\\": "tests/" + } } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4f3de2a..f66a042 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,11 +1,10 @@ - + + ./tests/ @@ -16,4 +15,7 @@ ./src/ - \ No newline at end of file + + + + diff --git a/tests/FactoryTest.php b/tests/FactoryTest.php index b669223..e25c810 100644 --- a/tests/FactoryTest.php +++ b/tests/FactoryTest.php @@ -1,5 +1,7 @@ serializer->createReplyModel(new Exception('ERR failure')); + $model = $this->serializer->createReplyModel(new \Exception('ERR failure')); $this->assertInstanceOf('Clue\Redis\Protocol\Model\ErrorReply', $model); $this->assertEquals('ERR failure', $model->getValueNative()); - $this->assertEquals($model->getMessageSerialized($this->serializer), $this->serializer->getReplyMessage(new Exception('ERR failure'))); + $this->assertEquals($model->getMessageSerialized($this->serializer), $this->serializer->getReplyMessage(new \Exception('ERR failure'))); } /** diff --git a/tests/Serializer/RecursiveSerializerTest.php b/tests/Serializer/RecursiveSerializerTest.php index fe62ac5..e991b86 100644 --- a/tests/Serializer/RecursiveSerializerTest.php +++ b/tests/Serializer/RecursiveSerializerTest.php @@ -1,5 +1,7 @@