/** * Test maskException method with turned on developer mode. */ public function testMaskNonWebapiException() { /** Assert exception was logged. */ $this->_loggerMock->expects($this->once())->method('logException'); $maskedException = $this->_errorProcessor->maskException(new LogicException()); /** Assert masked exception type is Mage_Webapi_Exception. */ $this->assertInstanceOf('Mage_Webapi_Exception', $maskedException, 'Masked exception type is not Webapi.'); /** Asser masked exception code is 500. */ $this->assertEquals(Mage_Webapi_Exception::HTTP_INTERNAL_ERROR, $maskedException->getCode(), 'Masked exception code is wrong.'); /** Assert masked exception message. */ $this->assertEquals('Internal Error. Details are available in Magento log file. Report ID: "%s"', $maskedException->getMessage(), 'Masked exception message is wrong.'); }
public function testSerialize() { $this->assertNotEmpty($this->_model->serialize()); $this->_logger->expects($this->once())->method('log'); $this->_model->add($this->_items['item1']); }