/** * @covers DmMailerAdmin\Controller\MessageController */ public function testToggleHaltActionSetsContentFalseOnSaveFailure() { $paramsMock = $this->mockFactory->getParamsMock(1); $flashMessengerMock = $this->mockFactory->getFlashMessengerPluginMock(-1, 0, -1, 1); $pluginManagerMock = $this->mockFactory->getPluginMock($paramsMock, $flashMessengerMock); $this->sut->setPluginManager($pluginManagerMock); $responseMock = $this->mockFactory->getResponseMock(); $this->repositoryMock->expects($this->any())->method('getOneById')->will($this->returnValue($this->getMessageMock())); $this->managerMock->expects($this->once())->method('saveEntity')->will($this->returnValue(false)); $responseMock->expects($this->once())->method('setContent')->with($this->equalTo('false')); $this->sut->setResponse($responseMock); $actualResult = $this->sut->toggleOnHaltAction(); $this->assertSame($responseMock, $actualResult); }