本文整理汇总了PHP中Storage::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::remove方法的具体用法?PHP Storage::remove怎么用?PHP Storage::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Storage
的用法示例。
在下文中一共展示了Storage::remove方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCanUnsetAVariable
public function testCanUnsetAVariable()
{
$this->namespace->testUnset = 5;
$this->assertEquals(5, $this->storage->get('testUnset'));
$this->storage->remove('testUnset');
$this->assertFalse(isset($this->namespace->testUnset));
$this->assertFalse($this->storage->has('testUnset'));
}
示例2: validate
/**
* validate
*
* Run validation process
*
* @return null
*/
public function validate()
{
parent::validate();
// compare protection code
if (property_exists($this->_data, 'protection_code')) {
$protectionCode = \Storage::read('protection-code-register');
\Storage::remove('protection-code-register');
if ($this->_data->protection_code !== $protectionCode) {
$this->addMessage('protection_code', \View::$language->register_form_protection_code_invalid);
}
}
// compare password confirmation
if (property_exists($this->_data, 'password') && property_exists($this->_data, 'confirm_password') && $this->_data->password !== $this->_data->confirm_password) {
$this->addMessage('confirm_password', \View::$language->register_form_password_confirm_mismatch);
}
// check for existence
if ($this->isValid()) {
$checkedFields = array('email', 'login');
$UserModel = \App::getInstance('common\\UserModel');
foreach ($checkedFields as $fName) {
if ($UserModel->isExists($fName, $this->_data->{$fName})) {
$mKey = 'register_form_' . $fName . '_is_exists';
$this->addMessage($fName, \View::$language->{$mKey});
}
}
}
}
示例3: testBase
/**
* Base testing
*/
public function testBase()
{
$storage = new Storage();
$alphabet = new Alphabet('en', array(), array(), array());
$storage->add($alphabet);
$this->assertEquals($alphabet, $storage->get('en'));
$this->assertEquals(array('en' => $alphabet), $storage->all());
$storage->remove($alphabet);
$this->assertNull($storage->get('en'));
}
示例4: rollback
/**
* rollback
*/
public function rollback()
{
$this->storage->remove($this->uri, $this->options);
if (is_null($this->previous)) {
$this->storage->remove($this->uri);
} else {
$this->storage->put($this->previous, $this->uri, $this->options);
}
$this->clean();
$this->initialize();
}
示例5: testRemove
/**
* @covers mychaelstyle\Storage::remove
* @covers mychaelstyle\Storage::get
* @covers mychaelstyle\Storage::put
* @depends testGet
*/
public function testRemove()
{
$def1 = $this->dsnMap['Local'];
$def2 = $this->dsnMap['Local2'];
$this->object->addProvider($def2['dsn'], $def2['options']);
// remove file
$this->object->remove($this->uri_example);
// assertLocalDeleted
$this->assertLocalDeleted($def1['dsn'], $this->uri_example);
$this->assertLocalDeleted($def2['dsn'], $this->uri_example);
}
示例6: validate
/**
* validate
*
* Run validation process
*
* @return null
*/
public function validate()
{
parent::validate();
// compare protection code
if (property_exists($this->_data, 'protection_code')) {
$protectionCode = \Storage::read('protection-code-sign-in');
\Storage::remove('protection-code-sign-in');
if ($this->_data->protection_code !== $protectionCode) {
$this->addMessage('protection_code', \View::$language->sign_in_form_protection_code_invalid);
}
}
// remove sign in counter data
if ($this->isValid()) {
\Storage::remove('sign-in-tries');
}
}
示例7: tearDown
protected function tearDown()
{
$this->storage->remove();
}