Dariusz Ruminski 6819c984d4 Add xml.xsd 8 years ago
..
Cache 330ec3585c Use Prophecy 8 years ago
Console 393e0cc9c9 ConfigurationResolver - Reject unknown rules 8 years ago
DocBlock 1a3d18bc78 Fix docs and small code issues 8 years ago
Error 1a3d18bc78 Fix docs and small code issues 8 years ago
Fixer 0dfd494bea Add deprecation notices tests 8 years ago
FixerDefinition 54c35a87a1 Enhancement: Allow to specify minimum and maximum PHP versions for code samples 8 years ago
Fixtures b97aa7c966 Add config option to DeclareEqualNormalizeFixer. 8 years ago
Linter fe4b7f6b52 Merge branch '1.13' 8 years ago
Report 6819c984d4 Add xml.xsd 8 years ago
Runner c162932042 Better handling of file name that is the same in multiple finder paths 8 years ago
Test 0dfd494bea Add deprecation notices tests 8 years ago
Tokenizer 4fac6225fd Merge branch '2.0' 8 years ago
AbstractFunctionReferenceFixerTest.php 23518f6cb4 DX: provide doctyping for tests 8 years ago
ConfigTest.php dc7eda6996 FixCommand - Support rules with params 8 years ago
FinderTest.php a41d933456 Tests - Do not use annotations for asserting exceptions 8 years ago
FixerFactoryTest.php 4fac6225fd Merge branch '2.0' 8 years ago
FixerNameValidatorTest.php b1051eb51d Normalize rule naming 8 years ago
IntegrationTest.php 19c04c1895 Code grooming 8 years ago
ProjectCodeTest.php 579770ed25 Add tests for not abusing interfaces 8 years ago
ReadmeTest.php c997bd3bb1 Merge branch '1.12' 9 years ago
RuleSetTest.php 2e8e3653f5 RuleSet - Check risky 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 5b262e4809 Fix code indentation 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`.'
);
}
}