本文整理匯總了PHP中lithium\util\Validator::__init方法的典型用法代碼示例。如果您正苦於以下問題:PHP Validator::__init方法的具體用法?PHP Validator::__init怎麽用?PHP Validator::__init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類lithium\util\Validator
的用法示例。
在下文中一共展示了Validator::__init方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
public function setUp()
{
$this->_backup['catalogConfig'] = Catalog::config();
Catalog::reset();
Catalog::config(array('runtime' => array('adapter' => new Memory())));
Validator::__init();
}
示例2: setUp
public function setUp()
{
$this->_backups['catalogConfig'] = Catalog::config();
Catalog::reset();
Catalog::config(array('lithium' => array('adapter' => 'Php', 'path' => LITHIUM_LIBRARY_PATH . '/lithium/g11n/resources/php')));
Validator::__init();
}
示例3: setUp
public function setUp()
{
$this->_backup['catalogConfig'] = Catalog::config();
Catalog::reset();
Catalog::config(array('lithium' => array('adapter' => 'Php', 'path' => Libraries::get('lithium', 'path') . '/g11n/resources/php')));
Validator::__init();
}
示例4: testStateReset
/**
* Tests that the rules state is reset when calling `Validator::__init()`.
*/
public function testStateReset()
{
$this->assertNull(Validator::rules('foo'));
Validator::add('foo', '/foo/');
$this->assertEqual('/foo/', Validator::rules('foo'));
Validator::__init();
$this->assertNull(Validator::rules('foo'));
}