Gregor Harlan 79067fb7ee rename fixers 9 years ago
..
Console 79067fb7ee rename fixers 9 years ago
DocBlock c997bd3bb1 Merge branch '1.12' 9 years ago
Error c997bd3bb1 Merge branch '1.12' 9 years ago
Fixer 79067fb7ee rename fixers 9 years ago
Fixtures 79067fb7ee rename fixers 9 years ago
Linter c997bd3bb1 Merge branch '1.12' 9 years ago
Standalone c997bd3bb1 Merge branch '1.12' 9 years ago
Test c997bd3bb1 Merge branch '1.12' 9 years ago
Tokenizer 9889075cca Merge branch '1.12' 9 years ago
AbstractFixerTest.php c997bd3bb1 Merge branch '1.12' 9 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 79067fb7ee rename fixers 9 years ago
FixerTest.php 5de5794c04 move fixer classes from level subdirs to type subdirs 9 years ago
IntegrationTest.php c997bd3bb1 Merge branch '1.12' 9 years ago
ReadmeTest.php c997bd3bb1 Merge branch '1.12' 9 years ago
RuleSetTest.php 79067fb7ee rename fixers 9 years ago
ToolInfoTest.php c997bd3bb1 Merge branch '1.12' 9 years ago
UtilsTest.php c997bd3bb1 Merge branch '1.12' 9 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`.'
);
}
}