diff --git a/composer.json b/composer.json index 63c7d4a..5f6a880 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "opis/closure": "Allow to serialize PHP closures" }, "require-dev": { - "phpunit/phpunit": ">=6.0 <10.0" + "phpunit/phpunit": ">=6.0 <11.0" }, "autoload": { "psr-4": { diff --git a/tests/ClosureSerializer/ClosureSerializerManagerTest.php b/tests/ClosureSerializer/ClosureSerializerManagerTest.php index b33dfef..b52abf4 100644 --- a/tests/ClosureSerializer/ClosureSerializerManagerTest.php +++ b/tests/ClosureSerializer/ClosureSerializerManagerTest.php @@ -8,6 +8,13 @@ class ClosureSerializerManagerTest extends TestCase { + public function setUp(): void + { + if (! class_exists(\SuperClosure\SerializerInterface::class)) { + $this->markTestSkipped('Missing jeremeamia/superclosure to run this test'); + } + } + public function testAddSerializer() { $manager = new ClosureSerializerManager(); $this->assertEmpty($manager->getSerializer('foo')); diff --git a/tests/ClosureSerializer/OpisClosureSerializerTest.php b/tests/ClosureSerializer/OpisClosureSerializerTest.php index 5950c23..54708a1 100644 --- a/tests/ClosureSerializer/OpisClosureSerializerTest.php +++ b/tests/ClosureSerializer/OpisClosureSerializerTest.php @@ -7,6 +7,13 @@ class OpisClosureSerializerTest extends TestCase { + public function setUp(): void + { + if (! class_exists(\Opis\Closure\SerializableClosure::class)) { + $this->markTestSkipped('Missing opis/closure to run this test'); + } + } + public function testSerialize() { $closure = function() { return 'foo'; diff --git a/tests/ClosureSerializer/SuperClosureSerializerTest.php b/tests/ClosureSerializer/SuperClosureSerializerTest.php index 7ba40c3..092220e 100644 --- a/tests/ClosureSerializer/SuperClosureSerializerTest.php +++ b/tests/ClosureSerializer/SuperClosureSerializerTest.php @@ -7,6 +7,13 @@ class SuperClosureSerializerTest extends TestCase { + public function setUp(): void + { + if (! class_exists(\SuperClosure\SerializerInterface::class)) { + $this->markTestSkipped('Missing jeremeamia/superclosure to run this test'); + } + } + public function testSerialize() { $closure = function() { return 'foo'; diff --git a/tests/JsonSerializerTest.php b/tests/JsonSerializerTest.php index 15fd8df..afa4512 100644 --- a/tests/JsonSerializerTest.php +++ b/tests/JsonSerializerTest.php @@ -81,10 +81,8 @@ public function testUnserializeScalar($scalar, $jsoned) /** * List of scalar data - * - * @return array */ - public function scalarData() + public static function scalarData(): array { return array( array('testing', '"testing"'), @@ -156,10 +154,8 @@ public function testUnserializeArrayNoObject($array, $jsoned) /** * List of array data - * - * @return array */ - public function arrayNoObjectData() + public static function arrayNoObjectData(): array { return array( array(array(1, 2, 3), '[1,2,3]'),