本文整理匯總了PHP中Magento\Backend\Model\Auth\Session::getUpdatedAt方法的典型用法代碼示例。如果您正苦於以下問題:PHP Session::getUpdatedAt方法的具體用法?PHP Session::getUpdatedAt怎麽用?PHP Session::getUpdatedAt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Backend\Model\Auth\Session
的用法示例。
在下文中一共展示了Session::getUpdatedAt方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testProcessProlong
/**
* Test of prolong user action
*
* @magentoDbIsolation enabled
*/
public function testProcessProlong()
{
$this->auth->login(\Magento\TestFramework\Bootstrap::ADMIN_NAME, \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD);
$sessionId = $this->authSession->getSessionId();
$dateInPast = $this->dateTime->formatDate($this->authSession->getUpdatedAt() - 100);
$this->adminSessionsManager->getCurrentSession()->setData('updated_at', $dateInPast)->save();
$this->adminSessionInfo->load($sessionId, 'session_id');
$oldUpdatedAt = $this->adminSessionInfo->getUpdatedAt();
$this->authSession->prolong();
$this->adminSessionInfo->load($sessionId, 'session_id');
$updatedAt = $this->adminSessionInfo->getUpdatedAt();
$this->assertGreaterThan($oldUpdatedAt, $updatedAt);
}
示例2: testProlong
public function testProlong()
{
$name = session_name();
$cookie = 'cookie';
$lifetime = 900;
$path = '/';
$domain = 'magento2';
$secure = true;
$httpOnly = true;
$this->cookie->expects($this->once())->method('get')->with($name)->will($this->returnValue($cookie));
$this->cookie->expects($this->once())->method('set')->with($name, $cookie, $lifetime, $path, $domain, $secure, $httpOnly);
$this->config->expects($this->once())->method('getValue')->with(\Magento\Backend\Model\Auth\Session::XML_PATH_SESSION_LIFETIME)->will($this->returnValue($lifetime));
$this->sessionConfig->expects($this->once())->method('getCookiePath')->will($this->returnValue($path));
$this->sessionConfig->expects($this->once())->method('getCookieDomain')->will($this->returnValue($domain));
$this->sessionConfig->expects($this->once())->method('getCookieSecure')->will($this->returnValue($secure));
$this->sessionConfig->expects($this->once())->method('getCookieHttpOnly')->will($this->returnValue($httpOnly));
$this->session->prolong();
$this->assertLessThanOrEqual(time(), $this->session->getUpdatedAt());
}
示例3: processProlong
/**
* Handle Prolong process
*
* @return $this
*/
public function processProlong()
{
$this->getCurrentSession()->setData('updated_at', $this->authSession->getUpdatedAt());
$this->getCurrentSession()->save();
return $this;
}