Dariusz Ruminski a6f2bf489d feature #1580 Added HeredocToNowdocFixer (gharlan) 9 years ago
..
Config 4e770cbec0 Added PhpUnitStrictFixer 9 years ago
DocBlock 19b065a2bb Code grooming - Improve utests code coverage 9 years ago
Finder f9301af809 Phpdocs and typos 10 years ago
Fixer a6f2bf489d feature #1580 Added HeredocToNowdocFixer (gharlan) 9 years ago
Fixtures d43a493a4b minor #1663 DuplicateSemicolonFixer - Remove duplicate semicolons even if there are comments between those (SpacePossum) 9 years ago
Tokenizer b6c39f5388 Code grooming 9 years ago
AbstractFixerTest.php f9301af809 Phpdocs and typos 10 years ago
AbstractIntegrationTest.php 8107f27a63 Php Inspections (EA Extended): fixed following inspections complains 9 years ago
ApplicationTest.php 19b065a2bb Code grooming - Improve utests code coverage 9 years ago
ConfigurationResolverTest.php 324fa99ec9 Tweak ConfigurationResolver tests 9 years ago
FixerTest.php d43a493a4b minor #1663 DuplicateSemicolonFixer - Remove duplicate semicolons even if there are comments between those (SpacePossum) 9 years ago
IntegrationTest.php dc7c9c1fdf Fix CS 9 years ago
ReadmeTest.php e05cf88cbf Travis - test lowest dependencies 10 years ago
ToolInfoTest.php 19b065a2bb Code grooming - Improve utests code coverage 9 years ago
UtilsTest.php 5d56a2ad19 Backport some minor changes from 2.x line 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
*/
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`.'
);
}
}