Ejemplo n.º 1
0
 /**
  * @magentoDbIsolation enabled
  */
 public function testLoginsAreLogged()
 {
     $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME);
     $lognum = $this->_model->getLognum();
     $beforeLogin = time();
     $this->_model->login(\Magento\TestFramework\Bootstrap::ADMIN_NAME, \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD)->reload();
     $loginTime = strtotime($this->_model->getLogdate());
     $this->assertTrue($beforeLogin <= $loginTime && $loginTime <= time());
     $this->assertEquals(++$lognum, $this->_model->getLognum());
     $beforeLogin = time();
     $this->_model->login(\Magento\TestFramework\Bootstrap::ADMIN_NAME, \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD)->reload();
     $loginTime = strtotime($this->_model->getLogdate());
     $this->assertTrue($beforeLogin <= $loginTime && $loginTime <= time());
     $this->assertEquals(++$lognum, $this->_model->getLognum());
 }