ResponseItem = new ResponseItem('error', 'errorMessage', array('foo' => null, 'bar' => 1)); } /** * Cleans up the environment after running a test. */ protected function tearDown() { $this->ResponseItem = null; parent::tearDown(); } /** * Tests ResponseItem->__construct() */ public function test__construct() { $this->ResponseItem->__construct('error', 'errorMessage', array('foo' => null, 'bar' => 1)); } /** * Tests ResponseItem->getError() */ public function testGetError() { $this->assertEquals('error', $this->ResponseItem->getError()); } /** * Tests ResponseItem->getErrorMessage() */ public function testGetErrorMessage() { $this->assertEquals('errorMessage', $this->ResponseItem->getErrorMessage()); } /** * Tests ResponseItem->getResponse() */ public function testGetResponse() { $expected = array('bar' => 1); $this->assertEquals($expected, $this->ResponseItem->getResponse()); } /** * Tests ResponseItem->setError() */ public function testSetError() { $this->ResponseItem->setError('seterror'); $this->assertEquals('seterror', $this->ResponseItem->getError()); } /** * Tests ResponseItem->setErrorMessage() */ public function testSetErrorMessage() { $this->ResponseItem->setErrorMessage('seterrormessage'); $this->assertEquals('seterrormessage', $this->ResponseItem->getErrorMessage()); } /** * Tests ResponseItem->setResponse() */ public function testSetResponse() { $expected = array('bar' => 2); $this->ResponseItem->setResponse($expected); $this->assertEquals($expected, $this->ResponseItem->getResponse()); } }