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

Fix PHPUnit 11 compatibility #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ jobs:
- name: Test with phpunit (with coverage)
id: phpunit-coverage
if: "matrix.coverage == 'coverage'"
run: composer run test -- --verbose ${{ env.COVERAGE_FLAGS }}
run: composer run test -- ${{ env.COVERAGE_FLAGS }}
- name: Test with phpunit (without coverage)
if: "matrix.coverage != 'coverage'"
run: composer run test -- --verbose
run: composer run test --
- name: Submit Coveralls
if: steps.phpunit-coverage.outcome == 'success'
uses: nick-invision/retry@v1
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"pear/versioncontrol_git": "^0.5",
"pear/pear-core-minimal": "^1.9",
"pear/pear_exception": "^1.0",
"phpunit/phpunit": "^8.5|^9.5",
"phpunit/phpunit": "^8.5|^9.5|^10|^11",
"symfony/console": "^5.0|^6.0",
"symfony/filesystem": "^5.0|^6.0",
"symfony/process": "^5.0|^6.0",
Expand Down
18 changes: 9 additions & 9 deletions tests/DisplayRegionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ public function testGetDisplayRegion(string $locale, string $inLocale, string $e
* @see testGetDisplayRegion
* @return array
*/
public function dataDisplayRegions(): array
public static function dataDisplayRegions(): array
{
return array_merge(
$this->dataForUnitedKingdom(),
$this->dataForGermany(),
$this->dataForMissingEntries(),
$this->dataForInvalidRegions()
self::dataForUnitedKingdom(),
self::dataForGermany(),
self::dataForMissingEntries(),
self::dataForInvalidRegions()
);
}

protected function dataForUnitedKingdom(): array
protected static function dataForUnitedKingdom(): array
{
return [
['en-GB', 'en-GB', 'United Kingdom'],
Expand All @@ -60,7 +60,7 @@ protected function dataForUnitedKingdom(): array
];
}

protected function dataForGermany(): array
protected static function dataForGermany(): array
{
return [
['-de', 'en-GB', 'Germany'],
Expand All @@ -74,15 +74,15 @@ protected function dataForGermany(): array
];
}

protected function dataForMissingEntries(): array
protected static function dataForMissingEntries(): array
{
return [
['-rs', 'en', 'Serbia'],
['-rs', 'ee', ''], // PHP returns 'RS' here, which I think is wrong...
];
}

protected function dataForInvalidRegions(): array
protected static function dataForInvalidRegions(): array
{
return [
['fake-too', 'en', ''],
Expand Down
4 changes: 2 additions & 2 deletions tests/PrimaryLanguageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function testGetPrimaryLanguage(string $locale, string $language): void
* @see testGetPrimaryLanguage
* @return array
*/
public function dataListOfPrimaryLanguages(): array
public static function dataListOfPrimaryLanguages(): array
{
return [
['af-ZA', 'af'],
Expand Down Expand Up @@ -256,7 +256,7 @@ public function testUnderscoreOrDash(string $locale, string $language): void
* @see testUnderscoreOrDash
* @return array
*/
public function dataUnderscoreOrDash(): array
public static function dataUnderscoreOrDash(): array
{
return [
['en-GB', 'en'],
Expand Down
2 changes: 1 addition & 1 deletion tests/RegionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function testGetRegion(string $locale, string $expectedRegion): void
* @see testGetRegion
* @return array
*/
public function dataListOfRegions(): array
public static function dataListOfRegions(): array
{
return [
['af-ZA', 'ZA'],
Expand Down
Loading