36 $this->_persistentSession = $this->_objectManager->get(\
Magento\Persistent\Helper\Session::class);
37 $this->_customerSession = $this->_objectManager->get(\
Magento\Customer\Model\Session::class);
38 $this->_model = $this->_objectManager->create(
39 \
Magento\Persistent\
Observer\SynchronizePersistentOnLoginObserver::class,
41 'persistentSession' => $this->_persistentSession,
42 'customerSession' => $this->_customerSession
50 public function testSynchronizePersistentOnLogin()
52 $event = new \Magento\Framework\Event();
53 $observer = new \Magento\Framework\Event\Observer([
'event' => $event]);
57 \
Magento\Customer\Api\CustomerRepositoryInterface::class
63 $this->_persistentSession->setRememberMeChecked(
true);
69 \
Magento\Persistent\Model\Session::class
71 $sessionModel->loadByCustomerId(1);
72 $this->assertEquals(1, $sessionModel->getCustomerId());
static getObjectManager()