/** * Sets up this test case * */ public function setUp() { $this->mockObjectManager = $this->createMock(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(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(Cli\CommandManager::class); $this->mockCommandManager->expects($this->any())->method('getCommandByIdentifier')->with('acme.test:default:list')->will($this->returnValue($this->mockCommand)); $this->mockReflectionService = $this->createMock(ReflectionService::class); $this->requestBuilder = new Cli\RequestBuilder(); $this->requestBuilder->injectObjectManager($this->mockObjectManager); $this->requestBuilder->injectCommandManager($this->mockCommandManager); }
/** * @return void */ public function setUp() { $this->command = $this->getAccessibleMock(Cli\Command::class, ['getCommandMethodReflection'], [], '', false); $this->methodReflection = $this->createMock(MethodReflection::class, [], [__CLASS__, 'dummyMethod']); $this->command->expects($this->any())->method('getCommandMethodReflection')->will($this->returnValue($this->methodReflection)); }