/** * @covers ErrorManager::setErrorMessage * @depends testAddError * @todo test passed but it is not pertinent. this function should return somthing * or throw an exception when tag doesn't exist. */ public function testSetErrorMessage(\ErrorManager $err) { $before = $err->getErrors(); $this->assertNotEmpty($before); $err->setErrorMessage('wrong', 'The required field is empty'); $this->assertSame($before, $err->getErrors()); $err->setErrorMessage('fail', 'The required field is empty'); $this->assertContainsOnlyInstancesOf('\\UserError', $this->manager->getErrors()); $this->assertEquals('The required field is empty', $err->getErrors()[0]->__toString()); }