Skip to content

Commit c3b464b

Browse files
committed
Update test environment and dev dependencies
1 parent 581b27c commit c3b464b

4 files changed

Lines changed: 21 additions & 12 deletions

File tree

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# clue/reactphp-redis
22

33
[![CI status](https://github.com/clue/reactphp-redis/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/reactphp-redis/actions)
4+
[![code coverage](https://img.shields.io/badge/code%20coverage-100%25-success)](#tests)
45
[![installs on Packagist](https://img.shields.io/packagist/dt/clue/redis-react?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/clue/redis-react)
56

67
Async [Redis](https://redis.io/) client implementation, built on top of [ReactPHP](https://reactphp.org/).
@@ -496,7 +497,7 @@ Once released, this project will follow [SemVer](https://semver.org/).
496497
At the moment, this will install the latest development version:
497498

498499
```bash
499-
$ composer require clue/redis-react:^3@dev
500+
composer require clue/redis-react:^3@dev
500501
```
501502

502503
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
@@ -510,7 +511,7 @@ smooth upgrade path. You may target multiple versions at the same time to
510511
support a wider range of PHP versions like this:
511512

512513
```bash
513-
$ composer require "clue/redis-react:^3@dev || ^2"
514+
composer require "clue/redis-react:^3@dev || ^2"
514515
```
515516

516517
## Tests
@@ -519,13 +520,21 @@ To run the test suite, you first need to clone this repo and then install all
519520
dependencies [through Composer](https://getcomposer.org/):
520521

521522
```bash
522-
$ composer install
523+
composer install
523524
```
524525

525526
To run the test suite, go to the project root and run:
526527

527528
```bash
528-
$ vendor/bin/phpunit
529+
vendor/bin/phpunit
530+
```
531+
532+
The test suite is set up to always ensure 100% code coverage across all
533+
supported environments. If you have the Xdebug extension installed, you can also
534+
generate a code coverage report locally like this:
535+
536+
```bash
537+
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text
529538
```
530539

531540
The test suite contains both unit tests and functional integration tests.
@@ -535,14 +544,14 @@ and will be skipped by default.
535544
If you don't have access to a running Redis server, you can also use a temporary `Redis` Docker image:
536545

537546
```bash
538-
$ docker run --net=host redis
547+
docker run --net=host redis
539548
```
540549

541550
To now run the functional tests, you need to supply *your* login
542551
details in an environment variable like this:
543552

544553
```bash
545-
$ REDIS_URI=localhost:6379 vendor/bin/phpunit
554+
REDIS_URI=localhost:6379 vendor/bin/phpunit
546555
```
547556

548557
## License

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
},
2222
"require-dev": {
2323
"clue/block-react": "^1.5",
24-
"phpstan/phpstan": "1.9.2 || 1.4.10",
25-
"phpunit/phpunit": "^9.5 || ^7.5"
24+
"phpstan/phpstan": "1.10.15 || 1.4.10",
25+
"phpunit/phpunit": "^9.6 || ^7.5"
2626
},
2727
"autoload": {
2828
"psr-4": { "Clue\\React\\Redis\\": "src/" }

phpunit.xml.dist

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

3-
<!-- PHPUnit configuration file with new format for PHPUnit 9.5+ -->
3+
<!-- PHPUnit configuration file with new format for PHPUnit 9.6+ -->
44
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
66
bootstrap="vendor/autoload.php"
77
cacheResult="false"
88
colors="true"
@@ -20,7 +20,7 @@
2020
<php>
2121
<ini name="error_reporting" value="-1" />
2222
<!-- Evaluate assertions, requires running with "php -d zend.assertions=1 vendor/bin/phpunit" -->
23-
<!-- <ini name="zend.assertions=1" value="1" /> -->
23+
<!-- <ini name="zend.assertions" value="1" /> -->
2424
<ini name="assert.active" value="1" />
2525
<ini name="assert.exception" value="1" />
2626
<ini name="assert.bail" value="0" />

phpunit.xml.legacy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<php>
1919
<ini name="error_reporting" value="-1" />
2020
<!-- Evaluate assertions, requires running with "php -d zend.assertions=1 vendor/bin/phpunit" -->
21-
<!-- <ini name="zend.assertions=1" value="1" /> -->
21+
<!-- <ini name="zend.assertions" value="1" /> -->
2222
<ini name="assert.active" value="1" />
2323
<ini name="assert.exception" value="1" />
2424
<ini name="assert.bail" value="0" />

0 commit comments

Comments
 (0)