/** * @access public * @param Zend_Validate_Interface|string|array $conditional * @throws Idun_Validate_Exception * @return Idun_Validate_Conditionable */ public function addConditional($conditional) { if (is_string($conditional) || is_array($conditional)) { $conditional = Idun_Validate::getValidator($conditional); } if (!$conditional instanceof Zend_Validate_Interface) { throw new Idun_Validate_Exception('Invalid conditional given. Must be an instance ' . 'of Zend_Validate_Interface.'); } $this->_conditionals[] = $conditional; return $this; }
/** * @static * @access public * @return void */ public static function unsetPluginLoader() { self::$_pluginLoader = null; }
/** * test is() with invalid params */ public function testIsWithInvalidParams() { try { Idun_Validate::is(123, 'Dummy'); $this->fail('Expected Idun_Validate_Exception has not been thrown'); } catch (Idun_Validate_Exception $exception) { $this->assertEquals('Validate class not found from basename \'Dummy\'', $exception->getMessage()); } }