Skip to content

Commit

Permalink
Merge pull request #59 from williamdes/phpunit
Browse files Browse the repository at this point in the history
phpunit improvements and support for phpunit 10
  • Loading branch information
jrbasso authored Sep 25, 2023
2 parents bebc68f + cbdc134 commit 8e72a3f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
7 changes: 7 additions & 0 deletions tests/ClosureSerializer/ClosureSerializerManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
7 changes: 7 additions & 0 deletions tests/ClosureSerializer/OpisClosureSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
7 changes: 7 additions & 0 deletions tests/ClosureSerializer/SuperClosureSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
8 changes: 2 additions & 6 deletions tests/JsonSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"'),
Expand Down Expand Up @@ -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]'),
Expand Down

0 comments on commit 8e72a3f

Please sign in to comment.