<commit_before><?php

namespace Doctrine\Tests\ODM\PHPCR\Tools\Command;

use Doctrine\ODM\PHPCR\Tools\Console\Command\DocumentConvertTranslationCommand;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Tester\CommandTester;

class DocumentConvertTranslationCommandTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var DocumentConvertTranslationCommand
     */
    private $command;

    /**
     * @var CommandTester
     */
    private $commandTester;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    private $converter;

    public function setUp()
    {
        $mockSession = $this->getMock('PHPCR\SessionInterface');
        $mockHelper = $this->getMock(
            'Symfony\Component\Console\Helper\HelperInterface',
            array('getSession', 'setHelperSet', 'getHelperSet', 'getName')
        );
        $mockHelper
            ->expects($this->once())
            ->method('getSession')
            ->will($this->returnValue($mockSession))
        ;
        $this->converter = $this->getMockBuilder('Doctrine\ODM\PHPCR\Tools\Helper\TranslationConverter')
            ->disableOriginalConstructor()
            ->getMock()
        ;
        $this->command = new DocumentConvertTranslationCommand(null, $this->converter);
        $this->command->setHelperSet(new HelperSet(
            array('phpcr' => $mockHelper)
        ));
        $this->commandTester = new CommandTester($this->command);
    }

    public function testCommand()
    {
        $this->converter
            ->expects($this->once())
            ->method('convert')
            ->with('Document\MyClass', array('en'), array(), 'none')
            ->will($this->returnValue(false))
        ;
        $this->commandTester->execute(array(
            'classname' => 'Document\MyClass',
            '--locales' => array('en'),
            '--force' => true,
        ));
        $this->assertEquals("done\n", $this->commandTester->getDisplay());
    }
}<commit_msg>Fix tests on Windows<commit_after><?php

namespace Doctrine\Tests\ODM\PHPCR\Tools\Command;

use Doctrine\ODM\PHPCR\Tools\Console\Command\DocumentConvertTranslationCommand;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Tester\CommandTester;

class DocumentConvertTranslationCommandTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var DocumentConvertTranslationCommand
     */
    private $command;

    /**
     * @var CommandTester
     */
    private $commandTester;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    private $converter;

    public function setUp()
    {
        $mockSession = $this->getMock('PHPCR\SessionInterface');
        $mockHelper = $this->getMock(
            'Symfony\Component\Console\Helper\HelperInterface',
            array('getSession', 'setHelperSet', 'getHelperSet', 'getName')
        );
        $mockHelper
            ->expects($this->once())
            ->method('getSession')
            ->will($this->returnValue($mockSession))
        ;
        $this->converter = $this->getMockBuilder('Doctrine\ODM\PHPCR\Tools\Helper\TranslationConverter')
            ->disableOriginalConstructor()
            ->getMock()
        ;
        $this->command = new DocumentConvertTranslationCommand(null, $this->converter);
        $this->command->setHelperSet(new HelperSet(
            array('phpcr' => $mockHelper)
        ));
        $this->commandTester = new CommandTester($this->command);
    }

    public function testCommand()
    {
        $this->converter
            ->expects($this->once())
            ->method('convert')
            ->with('Document\MyClass', array('en'), array(), 'none')
            ->will($this->returnValue(false))
        ;
        $this->commandTester->execute(array(
            'classname' => 'Document\MyClass',
            '--locales' => array('en'),
            '--force' => true,
        ));
        $this->assertEquals("done".PHP_EOL, $this->commandTester->getDisplay());
    }
}
{'fraction_non_alphanumeric': 0.14665672383793188, 'fraction_numerical': 0.0, 'mean_word_length': 2.5113438045375216, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 69, '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': '1093600', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1109, 'n_words': 155}