/** * Sets up this test case * */ public function setUp() { $this->mockObjectManager = $this->getMock('TYPO3\\FLOW3\\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\\FLOW3\\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\\FLOW3\\Cli\\CommandManager'); $this->mockCommandManager->expects($this->any())->method('getCommandByIdentifier')->with('acme.test:default:list')->will($this->returnValue($this->mockCommand)); $this->mockReflectionService = $this->getMock('TYPO3\\FLOW3\\Reflection\\ReflectionService'); $this->requestBuilder = new \TYPO3\FLOW3\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\\FLOW3\\Cli\\Command', array('getCommandMethodReflection'), array(), '', FALSE); $this->mockMethodReflection = $this->getMock('TYPO3\\FLOW3\\Reflection\\MethodReflection', array(), array(), '', FALSE); $this->command->expects($this->any())->method('getCommandMethodReflection')->will($this->returnValue($this->mockMethodReflection)); }