From 5245b18e51c6f882431c932cabea3b31f5764e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 25 Apr 2020 13:02:45 +0200 Subject: [PATCH 1/2] Update PHPUnit and clean up test suite --- composer.json | 5 ++++- phpunit.xml.dist | 7 +------ tests/CompressorTest.php | 2 ++ tests/DecompressorTest.php | 2 ++ tests/DeflateDecompressorTest.php | 2 ++ tests/DelateCompressorTest.php | 2 ++ tests/FunctionalExamplesTest.php | 2 ++ tests/GzipCompressorTest.php | 2 ++ tests/GzipDecompressorTest.php | 2 ++ tests/{bootstrap.php => TestCase.php} | 16 +++------------- tests/TransformStreamTest.php | 2 ++ tests/ZlibCompressorTest.php | 2 ++ tests/ZlibDecompressorTest.php | 2 ++ 13 files changed, 28 insertions(+), 20 deletions(-) rename tests/{bootstrap.php => TestCase.php} (67%) diff --git a/composer.json b/composer.json index c54b3ec..d47888c 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "react/stream": "^1.0 || ^0.7 || ^0.6" }, "require-dev": { - "phpunit/phpunit": "^5.0 || ^4.8", + "phpunit/phpunit": "^7.0 || ^6.0", "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3" }, "suggest": { @@ -24,5 +24,8 @@ }, "autoload": { "psr-4": { "Clue\\React\\Zlib\\": "src/" } + }, + "autoload-dev": { + "psr-4": { "Clue\\Tests\\React\\Zlib\\": "tests/" } } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4e6ec6c..a30c9fd 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,11 +1,6 @@ - + ./tests/ diff --git a/tests/CompressorTest.php b/tests/CompressorTest.php index 1d93db2..246eada 100644 --- a/tests/CompressorTest.php +++ b/tests/CompressorTest.php @@ -1,5 +1,7 @@ getMockBuilder('CallableStub')->getMock(); - } -} - -class CallableStub -{ - public function __invoke() - { + return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock(); } } diff --git a/tests/TransformStreamTest.php b/tests/TransformStreamTest.php index 87c25d2..1ad3fa0 100644 --- a/tests/TransformStreamTest.php +++ b/tests/TransformStreamTest.php @@ -1,5 +1,7 @@ Date: Sat, 25 Apr 2020 23:47:22 +0200 Subject: [PATCH 2/2] 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