Dariusz Rumiński 079341d13b solve TODO 1 year ago
..
CiConfigurationTest.php 671149b33c minor: use more spread operator (#7222) 1 year ago
CommandTest.php e042f44208 minor: more arrow function usage (#7223) 1 year ago
ComposerFileTest.php 0173a5b4ee DX: composer script aliases - ensure templated description (#7235) 1 year ago
DescribeCommandTest.php 7995c50100 DX: Include self_static_accessor fixer in PhpCsFixer set (#6882) 1 year ago
DocumentationTest.php f9190de2a1 minor: use JSON_THROW_ON_ERROR for trivial cases (#7221) 1 year ago
FixerFactoryTest.php 198d69ba58 fix: Priorities for fixers related to curly braces, empty lines and trailing whitespace (#7296) 1 year ago
PRTypeLabelsTest.php 079341d13b solve TODO 1 year ago
ProjectCodeTest.php e718e08db2 test: Introduce common way of creating fake Composer project in `InstallViaComposerTest` (#7265) 1 year ago
ProjectFixerConfigurationTest.php 7995c50100 DX: Include self_static_accessor fixer in PhpCsFixer set (#6882) 1 year ago
ReadmeTest.php 7995c50100 DX: Include self_static_accessor fixer in PhpCsFixer set (#6882) 1 year ago
TransformerTest.php 587def308a DX: apply `ReturnToYieldFromFixer` (#7181) 1 year ago

ReadmeTest.php


declare(strict_types=1);

/*
* This file is part of PHP CS Fixer.
*
* (c) Fabien Potencier
* Dariusz Rumiński
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Tests\AutoReview;

use PhpCsFixer\Tests\TestCase;

/**
* @author Victor Bocharsky
*
* @internal
*
* @coversNothing
*
* @group auto-review
* @group covers-nothing
*/
final class ReadmeTest extends TestCase
{
public function testSupportedPhpVersions(): void
{
$phpVersionIdLines = [];

$file = new \SplFileObject(__DIR__.'/../../php-cs-fixer');
while (!$file->eof()) {
$line = $file->fgets();
if (str_contains($line, 'PHP_VERSION_ID')) {
$phpVersionIdLines[] = $line;
}
}
// Unset the file to call __destruct(), closing the file handle.
$file = null;

self::assertEqualsCanonicalizing([
' if (\PHP_VERSION_ID === 80000) {'."\n",
' if (\PHP_VERSION_ID < 70400 || \PHP_VERSION_ID >= 80300) {'."\n",
], $phpVersionIdLines, 'Seems supported PHP versions changed in "./php-cs-fixer" - edit the README.md (and this test file) to match them!');
}
}