/** * @covers DmMailerAdmin\Controller\MessageController */ public function testUpdateActionRedirectsWhenHandlePostSuccess() { $paramsMock = $this->mockFactory->getParamsMock(1); $flashMessengerMock = $this->mockFactory->getFlashMessengerPluginMock(1, 0); $responseMock = $this->mockFactory->getResponseMock(); $redirectMock = $this->mockFactory->getRedirectPluginMock($responseMock); $pluginManagerMock = $this->mockFactory->getPluginMock($paramsMock, $flashMessengerMock, $redirectMock); $this->sut->setPluginManager($pluginManagerMock); $this->repositoryMock->expects($this->any())->method('getOneById')->will($this->returnValue($this->getMessageMock())); $this->managerMock->expects($this->any())->method('handlePost')->will($this->returnValue(true)); $actualResult = $this->sut->updateAction(); $this->assertSame($responseMock, $actualResult); }