AlberT 967592ac51 Fix multi-row description 8 years ago
..
Cache 330ec3585c Use Prophecy 8 years ago
Console b678791e45 Merge branch '1.13' 8 years ago
DocBlock 23518f6cb4 DX: provide doctyping for tests 8 years ago
Error c997bd3bb1 Merge branch '1.12' 9 years ago
Fixer 967592ac51 Fix multi-row description 8 years ago
Fixtures 8ed737f7ca DeclareStrictTypesFixer - do not move tokens 8 years ago
Linter fe4b7f6b52 Merge branch '1.13' 8 years ago
Report fe4b7f6b52 Merge branch '1.13' 8 years ago
Runner fe4b7f6b52 Merge branch '1.13' 8 years ago
Test c997bd3bb1 Merge branch '1.12' 9 years ago
Tokenizer 23518f6cb4 DX: provide doctyping for tests 8 years ago
AbstractFunctionReferenceFixerTest.php 23518f6cb4 DX: provide doctyping for tests 8 years ago
ConfigTest.php 2d2c998dd7 Enhance DescribeCommand, Fixer interfaces cleanup 8 years ago
FinderTest.php 0c942b0ee1 Code grooming 8 years ago
FixerFactoryTest.php b1051eb51d Normalize rule naming 8 years ago
FixerNameValidatorTest.php b1051eb51d Normalize rule naming 8 years ago
IntegrationTest.php 19c04c1895 Code grooming 8 years ago
ProjectCodeTest.php 23518f6cb4 DX: provide doctyping for tests 8 years ago
ReadmeTest.php c997bd3bb1 Merge branch '1.12' 9 years ago
RuleSetTest.php 78197a1bef minor #2312 RuleSet - sort rules (localheinz) 8 years ago
TextDiffTest.php bc324beef0 Concat*Fixer - unify concat fixers 8 years ago
ToolInfoTest.php c997bd3bb1 Merge branch '1.12' 9 years ago
UtilsTest.php 23518f6cb4 DX: provide doctyping for tests 8 years ago
WhitespacesFixerConfigTest.php 23518f6cb4 DX: provide doctyping for tests 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`.'
);
}
}