/** * Sets up this test case * */ public function setUp() { $this->mockObjectManager = $this->createMock(\TYPO3\Flow\Object\ObjectManagerInterface::class); $this->mockObjectManager->expects($this->any())->method('getObjectNameByClassName')->with('Acme\\Test\\Command\\DefaultCommandController')->will($this->returnValue('Acme\\Test\\Command\\DefaultCommandController')); $this->mockCommand = $this->getMockBuilder(\TYPO3\Flow\Cli\Command::class)->disableOriginalConstructor()->getMock(); $this->mockCommand->expects($this->any())->method('getControllerClassName')->will($this->returnValue('Acme\\Test\\Command\\DefaultCommandController')); $this->mockCommand->expects($this->any())->method('getControllerCommandName')->will($this->returnValue('list')); $this->mockCommandManager = $this->createMock(\TYPO3\Flow\Cli\CommandManager::class); $this->mockCommandManager->expects($this->any())->method('getCommandByIdentifier')->with('acme.test:default:list')->will($this->returnValue($this->mockCommand)); $this->mockReflectionService = $this->createMock(\TYPO3\Flow\Reflection\ReflectionService::class); $this->requestBuilder = new \TYPO3\Flow\Cli\RequestBuilder(); $this->requestBuilder->injectObjectManager($this->mockObjectManager); $this->requestBuilder->injectCommandManager($this->mockCommandManager); }
/** * Sets up this test case * */ public function setUp() { $this->mockObjectManager = $this->getMock('TYPO3\\Flow\\Object\\ObjectManagerInterface'); $this->mockObjectManager->expects($this->any())->method('getObjectNameByClassName')->with('Acme\\Test\\Command\\DefaultCommandController')->will($this->returnValue('Acme\\Test\\Command\\DefaultCommandController')); $this->mockCommand = $this->getMock('TYPO3\\Flow\\Cli\\Command', array(), array(), '', FALSE); $this->mockCommand->expects($this->any())->method('getControllerClassName')->will($this->returnValue('Acme\\Test\\Command\\DefaultCommandController')); $this->mockCommand->expects($this->any())->method('getControllerCommandName')->will($this->returnValue('list')); $this->mockCommandManager = $this->getMock('TYPO3\\Flow\\Cli\\CommandManager'); $this->mockCommandManager->expects($this->any())->method('getCommandByIdentifier')->with('acme.test:default:list')->will($this->returnValue($this->mockCommand)); $this->mockReflectionService = $this->getMock('TYPO3\\Flow\\Reflection\\ReflectionService'); $this->requestBuilder = new \TYPO3\Flow\Cli\RequestBuilder(); $this->requestBuilder->injectObjectManager($this->mockObjectManager); $this->requestBuilder->injectReflectionService($this->mockReflectionService); $this->requestBuilder->injectCommandManager($this->mockCommandManager); }
/** * @return void */ public function setUp() { $this->command = $this->getAccessibleMock(\TYPO3\Flow\Cli\Command::class, array('getCommandMethodReflection'), array(), '', false); $this->methodReflection = $this->createMock(\TYPO3\Flow\Reflection\MethodReflection::class); $this->command->expects($this->any())->method('getCommandMethodReflection')->will($this->returnValue($this->methodReflection)); }
/** * @return void */ public function setUp() { $this->command = $this->getAccessibleMock(\TYPO3\Flow\Cli\Command::class, array('getCommandMethodReflection'), array(), '', FALSE); $this->methodReflection = $this->getMock(\TYPO3\Flow\Reflection\MethodReflection::class, array(), array(__CLASS__, 'dummyMethod')); $this->command->expects($this->any())->method('getCommandMethodReflection')->will($this->returnValue($this->methodReflection)); }