Dariusz Ruminski e00b7c6d02 DX: extend integration tests for PSR2 and Symfony rulesets 8 years ago
..
Cache 1ace83a4c2 Disallow to disable linter 8 years ago
Console e5925bf9c0 ConfigurationResolver - passing non-existing path is ignored 8 years ago
DocBlock d061e8db95 Merge branch '1.12' 8 years ago
Error c997bd3bb1 Merge branch '1.12' 9 years ago
Fixer 6b55b6371b feature #2192 Add PowToExponentiationFixer (SpacePossum, keradus) 8 years ago
Fixtures e00b7c6d02 DX: extend integration tests for PSR2 and Symfony rulesets 8 years ago
Linter 26037ce4d3 TokenizerLintingResult - expose line number of parsing error 8 years ago
Report 7782a020e8 Merge branch '1.12' 8 years ago
Runner 1ace83a4c2 Disallow to disable linter 8 years ago
Standalone c997bd3bb1 Merge branch '1.12' 9 years ago
Test c997bd3bb1 Merge branch '1.12' 9 years ago
Tokenizer 2ce3466605 Introduce CT for PHP7 8 years ago
AbstractFixerTest.php c997bd3bb1 Merge branch '1.12' 9 years ago
AbstractFunctionReferenceFixerTest.php a7da7e9e47 AbstractFunctionReferenceFixerTest::testCountArguments - remove extra parameter 8 years ago
ConfigTest.php 19e4ad3e95 Move array fixer classes to new namespace 9 years ago
FinderTest.php c997bd3bb1 Merge branch '1.12' 9 years ago
FixerFactoryTest.php 6b55b6371b feature #2192 Add PowToExponentiationFixer (SpacePossum, keradus) 8 years ago
IntegrationTest.php c997bd3bb1 Merge branch '1.12' 9 years ago
ReadmeTest.php c997bd3bb1 Merge branch '1.12' 9 years ago
RuleSetTest.php c18509cd96 Fix 8 years ago
TextDiffTest.php b55eaa1a9c added junit format 8 years ago
ToolInfoTest.php c997bd3bb1 Merge branch '1.12' 9 years ago
UtilsTest.php 04c077de95 Add remove after/before structure open/close. 8 years ago

ReadmeTest.php


/*
* 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;

use PhpCsFixer\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;

/**
* @author Dariusz Rumiński
*
* @internal
*/
final class ReadmeTest extends \PHPUnit_Framework_TestCase
{
public function testIfReadmeFileIsCorrect()
{
if (!class_exists('Symfony\Component\Console\Output\BufferedOutput')) {
$this->markTestSkipped('Unsupported symfony/console version, Symfony\Component\Console\Output\BufferedOutput was added in 2.4.');
}

$input = new ArrayInput(array('readme'));
$output = new BufferedOutput();
$app = new Application();

$app->get('readme')->run($input, $output);

$fileContent = file_get_contents(__DIR__.'/../README.rst');

$this->assertSame(
$output->fetch(),
$fileContent,
'README.rst file is not up to date! Do not modify it manually! Regenerate readme with command: `php php-cs-fixer readme > README.rst`.'
);
}
}