/** * Ensures that getRegex() returns expected default values and throws an exception for unknown type * * @return void */ public function testGetRegex() { $this->assertEquals(Zend_Validate_Hostname::REGEX_LOCAL_DEFAULT, $this->_validator->getRegex('local')); try { $this->_validator->getRegex('does not exist'); $this->fail('Expected Zend_Validate_Exception not thrown for unknown regex type'); } catch (Zend_Validate_Exception $e) { $this->assertContains('must be one of', $e->getMessage()); } }