_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); /** @var \Magento\Persistent\Helper\Session $persistentSessionHelper */ $this->_persistentSessionHelper = $this->_objectManager->create(\Magento\Persistent\Helper\Session::class); $this->_customerSession = $this->_objectManager->get(\Magento\Customer\Model\Session::class); $this->_block = $this->_objectManager->create(\Magento\Persistent\Block\Header\Additional::class); } /** * @magentoConfigFixture current_store persistent/options/customer 1 * @magentoConfigFixture current_store persistent/options/enabled 1 * @magentoConfigFixture current_store persistent/options/remember_enabled 1 * @magentoConfigFixture current_store persistent/options/remember_default 1 * @magentoAppArea frontend * @magentoAppIsolation enabled */ public function testToHtml() { $this->_customerSession->loginById(1); $translation = __('Not you?'); $this->assertContains( '' . $translation . '', $this->_block->toHtml() ); $this->_customerSession->logout(); } }