Skip to content

Commit

Permalink
Install "phpunit/phpunit" ^10.5.20
Browse files Browse the repository at this point in the history
  • Loading branch information
danon committed May 22, 2024
1 parent d5f33e0 commit 072a157
Show file tree
Hide file tree
Showing 16 changed files with 266 additions and 388 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"fakerphp/faker": "^1.15",
"laravel/dusk": "^v7.12.1",
"mockery/mockery": "^1.4",
"phpunit/phpunit": "^9.0",
"phpunit/phpunit": "^10.5.20",
"rawr/phpunit-data-provider": "^3.3"
},
"autoload": {
Expand Down
587 changes: 235 additions & 352 deletions composer.lock

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions neon/test/Unit/JobOffers/JobOffersLaravelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ class JobOffersLaravelTest extends TestCase
use Laravel\Transactional;
use BaseFixture\PublicImageUrl;

protected function setUp(): void
{
$this->markAsRisky();
}

/**
* @test
*/
Expand Down
10 changes: 5 additions & 5 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<phpunit backupGlobals="false"
backupStaticAttributes="false"
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
backupGlobals="false"
backupStaticProperties="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
executionOrder="random"
stopOnFailure="false">
Expand Down
2 changes: 1 addition & 1 deletion tests/Legacy/DateDifferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function testFormat(string $format, string $expected): void
$date->format(new Carbon('2016-01-23 11:53:20')));
}

public function formats(): array
public static function formats(): array
{
return [
['%d-%m-%Y %H:%M', '23-01-2016 11:53'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/BaseFixture/Constraint/ArrayStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private function constraintMessages(): array
return $messages;
}

protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): never
{
parent::fail($other, $description,
new ComparisonFailure(null, null,
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/BaseFixture/Constraint/TrimmedString.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function toString(): string
return 'trimmed is ' . $this->exporter()->export($this->value);
}

protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): never
{
parent::fail($other, $description,
new ComparisonFailure(null, null,
Expand Down
16 changes: 8 additions & 8 deletions tests/Unit/BaseFixture/Constraint/Unit/ArrayStructureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ public function rejectLogicalAnd()
]);

$this->assertRejectsMessage($this->logicalAnd($constraint), ['key' => 'other'],
"Failed asserting that Array &0 (
'key' => 'other'
) value at 'key' is identical to 'value' and value at 'foo' is identical to 'bar'.");
"Failed asserting that Array &0 [
'key' => 'other',
] value at 'key' is identical to 'value' and value at 'foo' is identical to 'bar'.");
}

/**
Expand All @@ -121,11 +121,11 @@ public function rejectCompareActual()
$this->assertRejectsActual(
$constraint,
['one' => '11x1', 'two' => '222', 'three' => '333'],
"Array &0 (
'one' => '11x1'
'two' => '222'
'three' => '333'
)");
"Array &0 [
'one' => '11x1',
'two' => '222',
'three' => '333',
]");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/BaseFixture/Constraint/UrlPathEquals.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function additionalFailureDescription($other): string
}

#[Override]
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): never
{
parent::fail($other, $description,
new ComparisonFailure(null, null,
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/BaseFixture/Server/Laravel/StaticLaravel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ public static function get(\PHPUnit\Framework\TestCase $testCase): ?Laravel\Test
}
if (self::$laravel === null) {
$transactional = self::isTransactional($testCase);
self::$laravel = self::getInstance($transactional, self::bootTest($testCase));
self::$laravel = self::getInstance($testCase->name(), $transactional, self::bootTest($testCase));
self::$laravel->setUp();
}
return self::$laravel;
}

private static function getInstance(bool $transactional, callable $beforeBoot): Laravel\TestCase
private static function getInstance(string $name, bool $transactional, callable $beforeBoot): Laravel\TestCase
{
if ($transactional) {
return new class ($beforeBoot) extends Laravel\TestCase {
return new class ($name, $beforeBoot) extends Laravel\TestCase {
use DatabaseTransactions;
};
}
return new Laravel\TestCase($beforeBoot);
return new Laravel\TestCase($name, $beforeBoot);
}

public static function destroy(): void
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/BaseFixture/Server/Laravel/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class TestCase extends \Illuminate\Foundation\Testing\TestCase
/** @var callable */
private $beforeBoot;

public function __construct(callable $beforeBoot)
public function __construct(string $name, callable $beforeBoot)
{
parent::__construct();
parent::__construct($name);
$this->beforeBoot = $beforeBoot;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/OAuth/Fixture/Constraint/ResponseRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private function location(TestResponse $response): string
return $response->headers->get('Location');
}

protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): never
{
parent::fail($other, $description,
new ComparisonFailure(null, null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public function message()
$this->assertRejectsMessage(
new UrlContainsQuery(['foo' => 'bar']),
'http://actual/',
"Failed asserting that 'http://actual/' has query params Array &0 (
'foo' => 'bar'
).");
"Failed asserting that 'http://actual/' has query params Array &0 [
'foo' => 'bar',
].");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/OAuth/Fixture/Constraint/UrlBasepath.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function toString(): string
return 'has basepath ' . $this->exporter()->export($this->basePath);
}

protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): never
{
parent::fail($other, $description,
new ComparisonFailure(null, null,
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/OAuth/Fixture/Constraint/UrlContainsQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function toString(): string
return 'has query params ' . $this->exporter()->export($this->query);
}

protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): never
{
parent::fail($other, $description,
new ComparisonFailure(null, null,
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Seo/Schema/DiscussionForumPosting/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function canonical(string $field)
$this->relativeUri("/Forum/apple-forum/$topicId-banana_topic"));
}

public function fields(): DataProvider
public static function fields(): DataProvider
{
return DataProvider::list('@id', 'url');
}
Expand Down

0 comments on commit 072a157

Please sign in to comment.