Dariusz Ruminski b1fea58164 CLI: rename --config-file argument 9 years ago
..
Console b1fea58164 CLI: rename --config-file argument 9 years ago
DocBlock 1d913380e0 Switch to PSR-4 9 years ago
Error 1d913380e0 Switch to PSR-4 9 years ago
Fixer d02bb56725 Rename Fixers 9 years ago
Fixtures d02bb56725 Rename Fixers 9 years ago
Linter 1d913380e0 Switch to PSR-4 9 years ago
Standalone 1d913380e0 Switch to PSR-4 9 years ago
Test 1d913380e0 Switch to PSR-4 9 years ago
Tokenizer 1d913380e0 Switch to PSR-4 9 years ago
AbstractFixerTest.php 1d913380e0 Switch to PSR-4 9 years ago
ApplicationTest.php 1d913380e0 Switch to PSR-4 9 years ago
ConfigTest.php d02bb56725 Rename Fixers 9 years ago
FinderTest.php 0ba1846925 Remove non-default Config/Finder classes 9 years ago
FixerFactoryTest.php d02bb56725 Rename Fixers 9 years ago
FixerTest.php d02bb56725 Rename Fixers 9 years ago
IntegrationTest.php 1d913380e0 Switch to PSR-4 9 years ago
ReadmeTest.php 1d913380e0 Switch to PSR-4 9 years ago
RuleSetTest.php d02bb56725 Rename Fixers 9 years ago
ToolInfoTest.php 1d913380e0 Switch to PSR-4 9 years ago
UtilsTest.php 1d913380e0 Switch to PSR-4 9 years ago

ReadmeTest.php


/*
* This file is part of the PHP CS utility.
*
* (c) Fabien Potencier
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Symfony\CS\Tests;

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

/**
* @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`.'
);
}
}