public function testMapErrorCode() { $this->assertEquals(AgaviValidator::mapErrorCode('info'), AgaviValidator::INFO); $this->assertEquals(AgaviValidator::mapErrorCode('none'), AgaviValidator::NONE); $this->assertEquals(AgaviValidator::mapErrorCode('silent'), AgaviValidator::NONE); $this->assertEquals(AgaviValidator::mapErrorCode('notice'), AgaviValidator::NOTICE); $this->assertEquals(AgaviValidator::mapErrorCode('error'), AgaviValidator::ERROR); $this->assertEquals(AgaviValidator::mapErrorCode('critical'), AgaviValidator::CRITICAL); $this->assertEquals(AgaviValidator::mapErrorCode('cRiTiCaL'), AgaviValidator::CRITICAL); try { AgaviValidator::mapErrorCode('foo'); $this->fail(); } catch (AgaviValidatorException $e) { $this->assertEquals($e->getMessage(), 'unknown error code: foo'); } }