/**
  * @return void
  */
 public function testCleanExpiredSessions()
 {
     $timestamp = time();
     $this->adminSessionInfoCollectionFactoryMock->expects($this->once())->method('create')->willReturn($this->adminSessionInfoCollectionMock);
     $this->securityConfigMock->expects($this->once())->method('getCurrentTimestamp')->willReturn($timestamp);
     $this->adminSessionInfoCollectionMock->expects($this->once())->method('deleteSessionsOlderThen')->with($timestamp - AdminSessionsManager::ADMIN_SESSION_LIFETIME)->willReturnSelf();
     $this->model->cleanExpiredSessions();
 }
 /**
  * Test for cleanExpiredSessions() method
  *
  * @magentoDataFixture Magento/Security/_files/adminsession.php
  * @magentoAdminConfigFixture admin/security/session_lifetime 1
  * @magentoDbIsolation enabled
  */
 public function testCleanExpiredSessions()
 {
     /** @var \Magento\Security\Model\AdminSessionInfo $session */
     $session = $this->objectManager->create('Magento\\Security\\Model\\AdminSessionInfo');
     $collection = $this->getCollectionForCleanExpiredSessions($session);
     $sizeBefore = $collection->getSize();
     $this->adminSessionsManager->cleanExpiredSessions();
     $collection = $this->getCollectionForCleanExpiredSessions($session);
     $sizeAfter = $collection->getSize();
     $this->assertGreaterThan($sizeAfter, $sizeBefore);
 }