public function testIfReadmeFileIsCorrect() { $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`.'); }
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`.'); }
#!/usr/bin/env php <?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. */ if (defined('HHVM_VERSION_ID')) { if (HHVM_VERSION_ID < 30500) { fwrite(STDERR, "HHVM needs to be a minimum version of HHVM 3.5.0\n"); exit(1); } } elseif (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50306) { fwrite(STDERR, "PHP needs to be a minimum version of PHP 5.3.6\n"); exit(1); } Phar::mapPhar('php-cs-fixer.phar'); require_once 'phar://php-cs-fixer.phar/vendor/autoload.php'; use Symfony\CS\Console\Application; $application = new Application(); $application->run(); __halt_compiler();
public function testApplication() { $app = new Application(); $this->assertStringMatchesFormat('<info>PHP CS Fixer</info> version <comment>%d.%d%s</comment> by <comment>Fabien Potencier</comment>', $app->getLongVersion()); }