Skip to content

Commit

Permalink
Merge pull request #28 from cs278/upgrade-phpunit
Browse files Browse the repository at this point in the history
Upgrade PHPUnit Bridge
  • Loading branch information
cs278 authored Feb 17, 2025
2 parents 16a81ad + fe2ef84 commit 8bfc909
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"composer/composer": "^2@RC",
"composer/semver": "*",
"symfony/filesystem": "^4.4 || ^5 || ^6 || ^7",
"symfony/phpunit-bridge": "^5.2",
"symfony/phpunit-bridge": "^5.2 || ^6.4 || ^7",
"symfony/process": "^4.4 || ^5 || ^6 || ^7"
},
"conflict": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@

<php>
<ini name="zend.assertions" value="1" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="baselineFile=tests/allowed.json" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="verbose=0" />
</php>
</phpunit>
7 changes: 0 additions & 7 deletions tests/allowed.json

This file was deleted.

17 changes: 10 additions & 7 deletions tests/integration/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Composer\Composer;
use Composer\Semver\Semver;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
Expand All @@ -20,17 +19,18 @@
*/
final class IntegrationTest extends TestCase
{
use SetUpTearDownTrait;

/** @var string|null */
private static $cacheDir = null;

/** @var \Closure[] */
private static $cleanupAfterClass = [];

public static function doSetUpBeforeClass()
/**
* @beforeClass
*/
public static function prepareCache()
{
// Find cache directory of the users Composer installtion, if it cannot
// Find cache directory of the users Composer installation, if it cannot
// be found fallback to a temporary one for the lifetime of these tests.
$process = new Process([
'composer',
Expand All @@ -55,7 +55,10 @@ public static function doSetUpBeforeClass()
};
}

public static function doTearDownAfterClass()
/**
* @afterClass
*/
public static function cleanup()
{
try {
foreach (self::$cleanupAfterClass as $callback) {
Expand Down Expand Up @@ -214,7 +217,7 @@ private static function extractLockedPackages(string $lockFile): array
return $packages;
}

private static function executeCondition(string $condition, array $packages = null): bool
private static function executeCondition(string $condition, ?array $packages = null): bool
{
$template = <<<'EOT'
$isComposer = function ($constraint) {
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/AdvisoriesManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Composer\Composer;
use Composer\Semver\Semver;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
Expand All @@ -19,8 +18,6 @@
*/
final class AdvisoriesManagerTest extends TestCase
{
use SetUpTearDownTrait;

/**
* @dataProvider dataFindByPackageNameAndVersion
*
Expand Down

0 comments on commit 8bfc909

Please sign in to comment.