From cb8cf6edf616b624a7fa80b7d7965f1d0b929209 Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Fri, 5 Jun 2020 11:13:33 +0200 Subject: [PATCH 1/4] Run tests on PHP 7.4 and simplify test matrix --- .travis.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 30be35b..0a5430e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,23 @@ language: php -php: -# - 5.3 # requires old distro, see below - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - hhvm # ignore errors, see below - -# lock distro so future defaults will not break the build +# lock distro so new future defaults will not break the build dist: trusty matrix: include: - php: 5.3 dist: precise + - php: 5.4 + - php: 5.5 + - php: 5.6 + - php: 7.0 + - php: 7.1 + - php: 7.2 + - php: 7.3 + - php: 7.4 + - php: hhvm-3.18 allow_failures: - - php: hhvm + - php: hhvm-3.18 sudo: false From 6751f0fa5d63e965ec6ddd75ed8b0b5308fd45a3 Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Fri, 5 Jun 2020 11:37:49 +0200 Subject: [PATCH 2/4] Run tests on phpUnit 9 --- composer.json | 2 +- tests/FunctionalTest.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index c60ea02..4d2d5d7 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ }, "require-dev": { "clue/hexdump": "0.2.*", - "phpunit/phpunit": "^6.0 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.0 ||^6.0 || ^5.7 || ^4.8.35" }, "suggest": { "ext-sockets": "Requires PHP 5.4+ and the low level socket API for listening on multicast addresses (socket options to send IGMP announcements)" diff --git a/tests/FunctionalTest.php b/tests/FunctionalTest.php index a809509..18076a5 100644 --- a/tests/FunctionalTest.php +++ b/tests/FunctionalTest.php @@ -9,7 +9,10 @@ class FunctionalTest extends TestCase private $address = '224.224.244.244:2244'; - public function setUp() + /** + * @before + */ + public function setUpMocks() { $this->loop = React\EventLoop\Factory::create(); $this->factory = new Factory($this->loop); From 9fdc6ce9fcbfd1db32510a6f76204c97b664a15e Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Fri, 5 Jun 2020 11:43:41 +0200 Subject: [PATCH 3/4] Clean up test suite --- composer.json | 3 +++ phpunit.xml.dist | 7 +------ tests/FunctionalTest.php | 6 ++++-- tests/{bootstrap.php => TestCase.php} | 6 ++---- 4 files changed, 10 insertions(+), 12 deletions(-) rename tests/{bootstrap.php => TestCase.php} (87%) diff --git a/composer.json b/composer.json index 4d2d5d7..b190291 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,9 @@ "autoload": { "psr-4": { "Clue\\React\\Multicast\\": "src/" } }, + "autoload-dev": { + "psr-4": { "Clue\\Tests\\React\\Multicast\\": "tests/" } + }, "require": { "php": ">=5.3", "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2c9e43f..f80bbaa 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,11 +1,6 @@ - + ./tests/ diff --git a/tests/FunctionalTest.php b/tests/FunctionalTest.php index 18076a5..6229505 100644 --- a/tests/FunctionalTest.php +++ b/tests/FunctionalTest.php @@ -1,5 +1,7 @@ loop = React\EventLoop\Factory::create(); + $this->loop = \React\EventLoop\Factory::create(); $this->factory = new Factory($this->loop); } @@ -34,7 +36,7 @@ public function testMultipleReceivers() { try { $receiver1 = $this->factory->createReceiver($this->address); - } catch (BadMethodCallException $e) { + } catch (\BadMethodCallException $e) { $this->markTestSkipped('No multicast support'); } diff --git a/tests/bootstrap.php b/tests/TestCase.php similarity index 87% rename from tests/bootstrap.php rename to tests/TestCase.php index b27aa01..171dd2a 100644 --- a/tests/bootstrap.php +++ b/tests/TestCase.php @@ -1,10 +1,8 @@ Date: Fri, 5 Jun 2020 11:44:31 +0200 Subject: [PATCH 4/4] Add .gitattributes to exclude dev files from exports --- .gitattributes | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..0925d33 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +/.gitattributes export-ignore +/.gitignore export-ignore +/.travis.yml export-ignore +/examples/ export-ignore +/phpunit.xml.dist export-ignore +/tests/ export-ignore