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); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { DoctrineCommandHelper::setApplicationDocumentManager($this->getApplication(), $input->getOption('session')); return parent::execute($input, $output); }