Skip to content

Commit 0ec7efd

Browse files
committed
Update test suite and report failed assertions
1 parent 137cae7 commit 0ec7efd

File tree

5 files changed

+53
-25
lines changed

5 files changed

+53
-25
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66

77
jobs:
88
PHPUnit:
9-
runs-on: ubuntu-latest
9+
name: PHPUnit (PHP ${{ matrix.php }})
10+
runs-on: ubuntu-22.04
1011
strategy:
1112
matrix:
1213
php:
@@ -21,11 +22,12 @@ jobs:
2122
- 5.4
2223
- 5.3
2324
steps:
24-
- uses: actions/checkout@v2
25-
- name: Setup PHP
25+
- uses: actions/checkout@v3
2626
uses: shivammathur/setup-php@v2
2727
with:
2828
php-version: ${{ matrix.php }}
29+
coverage: xdebug
30+
ini-file: development
2931
- run: composer install
3032
- run: vendor/bin/phpunit --coverage-text
3133
if: ${{ matrix.php >= 7.3 }}
@@ -34,11 +36,16 @@ jobs:
3436

3537
PHPUnit-hhvm:
3638
name: PHPUnit (HHVM)
37-
runs-on: ubuntu-18.04
39+
runs-on: ubuntu-22.04
40+
continue-on-error: true
3841
steps:
39-
- uses: actions/checkout@v2
40-
- uses: azjezz/setup-hhvm@v1
42+
- uses: actions/checkout@v3
43+
- run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM
44+
- name: Run hhvm composer.phar install
45+
uses: docker://hhvm/hhvm:3.30-lts-latest
4146
with:
42-
version: lts-3.30
43-
- run: hhvm $(which composer) install
44-
- run: hhvm vendor/bin/phpunit
47+
args: hhvm composer.phar install
48+
- name: Run hhvm vendor/bin/phpunit
49+
uses: docker://hhvm/hhvm:3.30-lts-latest
50+
with:
51+
args: hhvm vendor/bin/phpunit

README.md

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

3-
[![CI status](https://github.com/clue/reactphp-zenity/workflows/CI/badge.svg)](https://github.com/clue/reactphp-zenity/actions)
3+
[![CI status](https://github.com/clue/reactphp-zenity/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/reactphp-zenity/actions)
44
[![installs on Packagist](https://img.shields.io/packagist/dt/clue/zenity-react?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/clue/zenity-react)
55

66
Zenity allows you to build graphical desktop (GUI) applications in PHP, built on top of [ReactPHP](https://reactphp.org/).
@@ -292,29 +292,29 @@ $builder->warning($text, $title = null);
292292

293293
## Install
294294

295-
The recommended way to install this library is [through Composer](https://getcomposer.org).
295+
The recommended way to install this library is [through Composer](https://getcomposer.org/).
296296
[New to Composer?](https://getcomposer.org/doc/00-intro.md)
297297

298298
This will install the latest supported version:
299299

300300
```bash
301-
$ composer require clue/zenity-react:^0.4.4
301+
composer require clue/zenity-react:^0.4.4
302302
```
303303

304304
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
305305

306306
This project aims to run on any platform and thus does not require any PHP
307307
extensions and supports running on legacy PHP 5.3 through current PHP 8+ and
308308
HHVM.
309-
It's *highly recommended to use PHP 7+* for this project.
309+
It's *highly recommended to use the latest supported PHP version* for this project.
310310

311311
Obviously, this library requires the Zenity binary itself.
312312
Zenity already ships with Ubuntu-based distributions and should not require any installation there.
313313
On Debian- and Ubuntu-based distributions you can make sure it's installed like this:
314314

315315
```bash
316316
# usually not required
317-
$ sudo apt-get install zenity
317+
sudo apt-get install zenity
318318
```
319319

320320
Otherwise you may have to install Zenity yourself (use your favorite search engine, download the appropriate realease tarball or compile from soure).
@@ -332,16 +332,16 @@ $launcher->setBin('/path/to/zenity');
332332
## Tests
333333

334334
To run the test suite, you first need to clone this repo and then install all
335-
dependencies [through Composer](https://getcomposer.org):
335+
dependencies [through Composer](https://getcomposer.org/):
336336

337337
```bash
338-
$ composer install
338+
composer install
339339
```
340340

341341
To run the test suite, go to the project root and run:
342342

343343
```bash
344-
$ php vendor/bin/phpunit
344+
php vendor/bin/phpunit
345345
```
346346

347347
## License

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818
},
1919
"require-dev": {
2020
"clue/block-react": "^1.1",
21-
"phpunit/phpunit": "^9.3 || ^5.7 || ^4.8"
21+
"phpunit/phpunit": "^9.6 || ^5.7 || ^4.8"
2222
},
2323
"autoload": {
24-
"psr-4": { "Clue\\React\\Zenity\\": "src/" }
24+
"psr-4": {
25+
"Clue\\React\\Zenity\\": "src/"
26+
}
2527
},
2628
"autoload-dev": {
27-
"psr-4": { "Clue\\Tests\\React\\Zenity\\": "tests/" }
29+
"psr-4": {
30+
"Clue\\Tests\\React\\Zenity\\": "tests/"
31+
}
2832
}
2933
}

phpunit.xml.dist

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

3-
<!-- PHPUnit configuration file with new format for PHPUnit 9.3+ -->
4-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
3+
<!-- PHPUnit configuration file with new format for PHPUnit 9.6+ -->
4+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
66
bootstrap="vendor/autoload.php"
7+
cacheResult="false
78
colors="true"
8-
cacheResult="false">
9+
convertDeprecationsToExceptions="true">
910
<testsuites>
1011
<testsuite name="Zenity React Test Suite">
1112
<directory>./tests/</directory>
@@ -16,4 +17,12 @@
1617
<directory>./src/</directory>
1718
</include>
1819
</coverage>
20+
<php>
21+
<ini name="error_reporting" value="-1" />
22+
<!-- Evaluate assertions, requires running with "php -d zend.assertions=1 vendor/bin/phpunit" -->
23+
<!-- <ini name="zend.assertions" value="1" /> -->
24+
<ini name="assert.active" value="1" />
25+
<ini name="assert.exception" value="1" />
26+
<ini name="assert.bail" value="0" />
27+
</php>
1928
</phpunit>

phpunit.xml.legacy

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

3-
<!-- PHPUnit configuration file with old format for PHPUnit 9.2 or older -->
3+
<!-- PHPUnit configuration file with old format for legacy PHPUnit -->
44
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd"
66
bootstrap="vendor/autoload.php"
@@ -15,4 +15,12 @@
1515
<directory>./src/</directory>
1616
</whitelist>
1717
</filter>
18+
<php>
19+
<ini name="error_reporting" value="-1" />
20+
<!-- Evaluate assertions, requires running with "php -d zend.assertions=1 vendor/bin/phpunit" -->
21+
<!-- <ini name="zend.assertions" value="1" /> -->
22+
<ini name="assert.active" value="1" />
23+
<ini name="assert.exception" value="1" />
24+
<ini name="assert.bail" value="0" />
25+
</php>
1826
</phpunit>

0 commit comments

Comments
 (0)