1
0
Fork 0

Add support for phpunit 10 (#11532)

* Use static test data providers

Using non-static methods as a data providers was deprecated in phpunit
10.

* Rename abstract test class

Abstract test case classes with Test suffix are deprecated in PHPUnit
10. We also change the ArchiverTest file name to match the new class
name (ArchiverTestCase).

* https://github.com/sebastianbergmann/phpunit/issues/5132
pull/11536/head
Athos Ribeiro 2023-07-21 10:39:20 +02:00 committed by GitHub
parent e7016b00a9
commit 4b210d916e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 6 deletions

View File

@ -57,7 +57,7 @@ class HomeCommandTest extends TestCase
$this->assertSame(trim($expected), trim($appTester->getDisplay(true)));
}
public function useCaseProvider(): Generator
public static function useCaseProvider(): Generator
{
yield 'Invalid or missing repository URL' => [
[

View File

@ -129,7 +129,7 @@ class SuggestsCommandTest extends TestCase
self::assertSame(trim($expected), trim($appTester->getDisplay(true)));
}
public function provideSuggest(): \Generator
public static function provideSuggest(): \Generator
{
yield 'with lockfile, show suggested' => [
true,

View File

@ -21,7 +21,7 @@ use Composer\Test\Mock\FactoryMock;
use Composer\Util\Platform;
use Composer\Util\ProcessExecutor;
class ArchiveManagerTest extends ArchiverTest
class ArchiveManagerTest extends ArchiverTestCase
{
/**
* @var ArchiveManager

View File

@ -17,7 +17,7 @@ use Composer\Util\Filesystem;
use Composer\Util\ProcessExecutor;
use Composer\Package\CompletePackage;
abstract class ArchiverTest extends TestCase
abstract class ArchiverTestCase extends TestCase
{
/**
* @var \Composer\Util\Filesystem

View File

@ -15,7 +15,7 @@ namespace Composer\Test\Package\Archiver;
use Composer\Package\Archiver\PharArchiver;
use Composer\Util\Platform;
class PharArchiverTest extends ArchiverTest
class PharArchiverTest extends ArchiverTestCase
{
public function testTarArchive(): void
{

View File

@ -16,7 +16,7 @@ use Composer\Util\Platform;
use ZipArchive;
use Composer\Package\Archiver\ZipArchiver;
class ZipArchiverTest extends ArchiverTest
class ZipArchiverTest extends ArchiverTestCase
{
/**
* @dataProvider provideGitignoreExcludeNegationTestCases