/** * @covers Xoops\Core\Service\Response::addErrorMessage */ public function testAddErrorMessage() { $value = 'value'; $error = 'error'; $instance = new Response($value, true, $error); $error1 = 'error1'; $result = $instance->addErrorMessage($error1); $this->assertSame($instance, $result); $data = array('error2', 'error3'); $result = $instance->addErrorMessage($data); $result = $instance->getErrorMessage(); $this->assertTrue(is_array($result)); $this->assertTrue(in_array($error, $result)); $this->assertTrue(in_array($error1, $result)); $this->assertTrue(in_array('error2', $result)); $this->assertTrue(in_array('error3', $result)); }