Skip to content

Commit 18dbae0

Browse files
committed
Use PHPUnit 9.x when available
Allow testing with PHPUnit 9.x on PHP 7.3+.
1 parent a0d31bd commit 18dbae0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require-dev": {
1919
"composer/composer": "^1.1",
2020
"php-parallel-lint/php-parallel-lint": "~1.1.0",
21-
"phpunit/phpunit": "^8.5",
21+
"phpunit/phpunit": "^8.5||^9.0",
2222
"squizlabs/php_codesniffer": "~3.5.4"
2323
},
2424
"autoload": {

tests/phpunit/MergePluginTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,10 +529,15 @@ function ($args) use ($that) {
529529
$that->assertEquals(2, count($repos));
530530
$prependedRepo = $repos[0];
531531
$that->assertInstanceOf('Composer\Repository\VcsRepository', $prependedRepo);
532-
$that->assertAttributeEquals(
532+
// Ugly, be we need to check a protected member variable and
533+
// PHPUnit decided that having the assertAttributeEquals
534+
// assertion to make that easy was a code smell.
535+
$clazz = new \ReflectionClass($prependedRepo);
536+
$url = $clazz->getProperty('url');
537+
$url->setAccessible(true);
538+
$that->assertEquals(
533539
'https://github.com/furgas/composer-merge-plugin.git',
534-
'url',
535-
$prependedRepo
540+
$url->getValue($prependedRepo)
536541
);
537542
}
538543
);

0 commit comments

Comments
 (0)