<commit_before><?php
namespace Corley\VersionBundle\Tests\Command;

use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Corley\VersionBundle\Command\VersionCommand;
use org\bovigo\vfs\vfsStream;
use Symfony\Component\Yaml\Parser;
use Symfony\Component\Yaml\Dumper;

class VersionCommandTest extends \PHPUnit_Framework_TestCase
{
    private $kernel;
    private $parser;
    private $dumper;
    private $root;

    private function prepareCommand()
    {
        $this->kernel = $this->getMock('Symfony\\Component\\HttpKernel\\KernelInterface');
        $this->parser = new Parser();
        $this->dumper = new Dumper();

        $application = new Application($this->kernel);
        $application->add(new VersionCommand($this->parser, $this->dumper));

        $this->root = vfsStream::setup('config');

        $command = $application->find('corley:version');
        $command->setRootDir(vfsStream::url('config'));

        $commandTester = new CommandTester($command);

        return $commandTester;
    }

    public function testBumpANewVersion()
    {
        $commandTester = $this->prepareCommand();

        $commandTester->execute(array("version" => "x.x.x"));
        $this->assertEquals('{ parameters: { version: { number: x.x.x } } }', file_get_contents(vfsStream::url('config/version.yml')));
    }
}<commit_msg>Just checked also the command output<commit_after><?php
namespace Corley\VersionBundle\Tests\Command;

use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Corley\VersionBundle\Command\VersionCommand;
use org\bovigo\vfs\vfsStream;
use Symfony\Component\Yaml\Parser;
use Symfony\Component\Yaml\Dumper;

class VersionCommandTest extends \PHPUnit_Framework_TestCase
{
    private $kernel;
    private $parser;
    private $dumper;
    private $root;

    private function prepareCommand()
    {
        $this->kernel = $this->getMock('Symfony\\Component\\HttpKernel\\KernelInterface');
        $this->parser = new Parser();
        $this->dumper = new Dumper();

        $application = new Application($this->kernel);
        $application->add(new VersionCommand($this->parser, $this->dumper));

        $this->root = vfsStream::setup('config');

        $command = $application->find('corley:version');
        $command->setRootDir(vfsStream::url('config'));

        $commandTester = new CommandTester($command);

        return $commandTester;
    }

    /**
     * @group functional
     * @group command
     */
    public function testBumpANewVersion()
    {
        $commandTester = $this->prepareCommand();

        $commandTester->execute(array("version" => "x.x.x"));

        $this->assertEquals('{ parameters: { version: { number: x.x.x } } }', file_get_contents(vfsStream::url('config/version.yml')));
        $this->assertRegExp('/Bumped version: \'x.x.x\'/', $commandTester->getDisplay());
    }
}
{'fraction_non_alphanumeric': 0.14937478877999325, 'fraction_numerical': 0.0, 'mean_word_length': 3.6540880503144653, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2347142', 'n_tokens_mistral': 884, 'n_tokens_neox': 864, 'n_words': 147}