Skip to content

Commit 34e21bc

Browse files
committed
remove unneeded test
1 parent 0709f30 commit 34e21bc

File tree

1 file changed

+3
-45
lines changed

1 file changed

+3
-45
lines changed

tests/Util/PhpVersionTest.php renamed to tests/Util/PhpCompatUtilTest.php

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,55 +11,16 @@
1111

1212
namespace Symfony\Bundle\MakerBundle\Tests\Util;
1313

14+
use PHPUnit\Framework\MockObject\MockObject;
1415
use PHPUnit\Framework\TestCase;
1516
use Symfony\Bundle\MakerBundle\FileManager;
1617
use Symfony\Bundle\MakerBundle\Util\PhpCompatUtil;
17-
use Symfony\Component\HttpKernel\Kernel;
1818

1919
/**
2020
* @author Jesse Rushlow <[email protected]>
2121
*/
22-
class PhpVersionTest extends TestCase
22+
class PhpCompatUtilTest extends TestCase
2323
{
24-
/**
25-
* @dataProvider phpVersionDataProvider
26-
*/
27-
public function testUsesPhpPlatformFromComposerJsonFileForCanUseAttributes(string $version, bool $expectedResult): void
28-
{
29-
$this->markTestSkipped('This test needs to be refactored if we keep the util.');
30-
$mockFileManager = $this->mockFileManager(sprintf('{"platform-overrides": {"php": "%s"}}', $version));
31-
32-
$version = new PhpCompatUtil($mockFileManager);
33-
34-
// $result = $version->canUseAttributes();
35-
36-
/*
37-
* Symfony 5.2 is required to compare the result. Otherwise it will always
38-
* return false regardless of the PHP Version. If the test suite is run w/
39-
* Symfony < 5.2, we assert false here but still rely on the assertions above.
40-
*/
41-
if (Kernel::VERSION_ID < 50200) {
42-
$expectedResult = false;
43-
}
44-
45-
self::assertSame($expectedResult, $result);
46-
}
47-
48-
public function phpVersionDataProvider(): \Generator
49-
{
50-
yield ['8', true];
51-
yield ['8.0', true];
52-
yield ['8.0.1', true];
53-
yield ['8RC1', true];
54-
yield ['8.1alpha1', true];
55-
yield ['8.0.0beta2', true];
56-
yield ['8beta', true];
57-
yield ['7', false];
58-
yield ['7.0', false];
59-
yield ['7.1.1', false];
60-
yield ['7.0.0RC3', false];
61-
}
62-
6324
public function testFallBackToPhpVersionWithoutLockFile(): void
6425
{
6526
$mockFileManager = $this->createMock(FileManager::class);
@@ -99,10 +60,7 @@ public function testWithoutPlatformVersionSet(): void
9960
self::assertSame(\PHP_VERSION, $result);
10061
}
10162

102-
/**
103-
* @return \PHPUnit\Framework\MockObject\MockObject|FileManager
104-
*/
105-
private function mockFileManager(string $json)
63+
private function mockFileManager(string $json): MockObject|FileManager
10664
{
10765
$mockFileManager = $this->createMock(FileManager::class);
10866
$mockFileManager

0 commit comments

Comments
 (0)