Dariusz Rumiński 4dec30a27b CI: build phar on PHP 8.3 (#8195) 2 weeks ago
..
CiConfigurationTest.php 4dec30a27b CI: build phar on PHP 8.3 (#8195) 2 weeks ago
CommandTest.php 601f01f472 chore: add `@return` tags for data providers that do not have array in data (#8179) 4 weeks ago
ComposerFileTest.php 4a944844d3 DX: fix checking test class extends `PhpCsFixer\Tests\TestCase` (#7567) 9 months ago
DescribeCommandTest.php 1251948699 feat: Add sprintf in the list of compiler optimized functions (#8092) 3 months ago
DocumentationTest.php 601f01f472 chore: add `@return` tags for data providers that do not have array in data (#8179) 4 weeks ago
FixerFactoryTest.php 601f01f472 chore: add `@return` tags for data providers that do not have array in data (#8179) 4 weeks ago
ProjectCodeTest.php 601f01f472 chore: add `@return` tags for data providers that do not have array in data (#8179) 4 weeks ago
ProjectFixerConfigurationTest.php 064efa1f89 refactor: refactor to templated trait+interface (#7988) 3 months ago
ReadmeTest.php 45a453070b chore: officially support PHP 8.3 (#7466) 9 months ago
TransformerTest.php 601f01f472 chore: add `@return` tags for data providers that do not have array in data (#8179) 4 weeks 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 >= 80400) {'."\n",
], $phpVersionIdLines, 'Seems supported PHP versions changed in "./php-cs-fixer" - edit the README.md (and this test file) to match them!');
}
}