Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpunit improvements and support for phpunit 10 #59

Merged
merged 3 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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