Skip to content

Commit

Permalink
tec: Upgrade to PHPUnit 10
Browse files Browse the repository at this point in the history
  • Loading branch information
marienfressinaud committed Aug 7, 2023
1 parent dff1ccf commit d53c58d
Show file tree
Hide file tree
Showing 12 changed files with 248 additions and 372 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ icons-build: ## Build the icons asset
.PHONY: test
test: ## Run the test suite
$(PHP) ./vendor/bin/phpunit \
$(COVERAGE) --whitelist ./src --whitelist ./lib/SpiderBits \
$(COVERAGE) --coverage-filter ./src --coverage-filter ./lib/SpiderBits \
--bootstrap ./tests/bootstrap.php \
--testdox \
$(PHPUNIT_FILTER) \
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require-dev": {
"phpunit/phpunit": "^9.1",
"phpunit/phpunit": "^10.3",
"squizlabs/php_codesniffer": "^3.5",
"fakerphp/faker": "^1.17",
"phpstan/phpstan": "^1.10"
Expand Down
582 changes: 229 additions & 353 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/controllers/OnboardingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function testUpdateLocaleRedirectsIfLocaleIsInvalid(): void
/**
* @return array<array{int}>
*/
public function validStepsProvider(): array
public static function validStepsProvider(): array
{
return [
[1],
Expand All @@ -142,7 +142,7 @@ public function validStepsProvider(): array
/**
* @return array<array{int}>
*/
public function invalidStepsProvider(): array
public static function invalidStepsProvider(): array
{
$faker = \Faker\Factory::create();
/** @var int */
Expand Down
4 changes: 2 additions & 2 deletions tests/controllers/collections/ImagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ public function testUpdateFailsIfFileFailedToUpload(int $error): void
/**
* @return array<array{int}>
*/
public function tooLargeErrorsProvider(): array
public static function tooLargeErrorsProvider(): array
{
return [
[UPLOAD_ERR_INI_SIZE],
Expand All @@ -536,7 +536,7 @@ public function tooLargeErrorsProvider(): array
/**
* @return array<array{int}>
*/
public function otherFileErrorsProvider(): array
public static function otherFileErrorsProvider(): array
{
return [
[UPLOAD_ERR_PARTIAL],
Expand Down
4 changes: 2 additions & 2 deletions tests/controllers/importations/OpmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public function testImportFailsIfIsUploadedFileReturnsFalse(): void
/**
* @return array<array{int}>
*/
public function tooLargeErrorsProvider(): array
public static function tooLargeErrorsProvider(): array
{
return [
[UPLOAD_ERR_INI_SIZE],
Expand All @@ -331,7 +331,7 @@ public function tooLargeErrorsProvider(): array
/**
* @return array<array{int}>
*/
public function otherFileErrorsProvider(): array
public static function otherFileErrorsProvider(): array
{
return [
[UPLOAD_ERR_PARTIAL],
Expand Down
4 changes: 2 additions & 2 deletions tests/controllers/my/AvatarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public function testUpdateFailsIfFileFailedToUpload(int $error): void
/**
* @return array<array{int}>
*/
public function tooLargeErrorsProvider(): array
public static function tooLargeErrorsProvider(): array
{
return [
[UPLOAD_ERR_INI_SIZE],
Expand All @@ -264,7 +264,7 @@ public function tooLargeErrorsProvider(): array
/**
* @return array<array{int}>
*/
public function otherFileErrorsProvider(): array
public static function otherFileErrorsProvider(): array
{
return [
[UPLOAD_ERR_PARTIAL],
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/SpiderBits/ClearUrlsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function testClear(string $tracked_url, string $expected_url): void
/**
* @return array<array{string, string}>
*/
public function clearProvider(): array
public static function clearProvider(): array
{
return [
// utm_* parameters in URL query
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/SpiderBits/UrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function testIsValidFailsWithAnInvalidScheme(): void
/**
* @return array<array{string, string, string}>
*/
public function absolutizeProvider(): array
public static function absolutizeProvider(): array
{
return [
['https://host', '/path', 'https://host/path'],
Expand Down Expand Up @@ -134,7 +134,7 @@ public function absolutizeProvider(): array
/**
* @return array<array{string, string}>
*/
public function sanitizeProvider(): array
public static function sanitizeProvider(): array
{
// This test suite comes from https://developers.google.com/safe-browsing/v4/urls-hashing#canonicalization
// Minor differences are indicated in comments
Expand Down Expand Up @@ -206,7 +206,7 @@ public function sanitizeProvider(): array
* array<string, string|null|array<?string>>
* }>
*/
public function parseAndBuildQueryProvider(): array
public static function parseAndBuildQueryProvider(): array
{
return [
[
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/SpiderBits/feeds/FeedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public function testIsFeedContentTypeWithInvalidContentTypeReturnsTrue(string $c
/**
* @return array<array{string}>
*/
public function validContentType(): array
public static function validContentType(): array
{
return [
['application/atom+xml'],
Expand All @@ -466,7 +466,7 @@ public function validContentType(): array
/**
* @return array<array{string}>
*/
public function invalidContentType(): array
public static function invalidContentType(): array
{
return [
[''],
Expand Down
2 changes: 1 addition & 1 deletion tests/models/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testResizeRectangle(array $initial_size, array $destination_size
* },
* }>
*/
public function resizeProvider(): array
public static function resizeProvider(): array
{
return [
[
Expand Down
4 changes: 2 additions & 2 deletions tests/utils/LocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testBestWithFrench(string $accept_language): void
/**
* @return array<array{string}>
*/
public function englishAcceptLanguage(): array
public static function englishAcceptLanguage(): array
{
return [
[''],
Expand All @@ -43,7 +43,7 @@ public function englishAcceptLanguage(): array
/**
* @return array<array{string}>
*/
public function frenchAcceptLanguage(): array
public static function frenchAcceptLanguage(): array
{
return [
['fr'],
Expand Down

0 comments on commit d53c58d

Please sign in to comment.