◆ setUp()
Definition at line 44 of file EmulateQuoteObserverTest.php.
48 $this->_customerSession = $this->_objectManager->get(\
Magento\Customer\Model\Session::class);
50 $this->customerRepository = $this->_objectManager->create(
51 \
Magento\Customer\Api\CustomerRepositoryInterface::class
54 $this->_checkoutSession = $this->getMockBuilder(
55 \
Magento\Checkout\Model\Session::class
56 )->disableOriginalConstructor()->setMethods([])->getMock();
58 $this->_persistentSessionHelper = $this->_objectManager->create(\
Magento\Persistent\Helper\Session::class);
60 $this->_observer = $this->_objectManager->create(
61 \
Magento\Persistent\Observer\EmulateQuoteObserver::class,
63 'customerRepository' => $this->customerRepository,
64 'checkoutSession' => $this->_checkoutSession,
65 'persistentSession' => $this->_persistentSessionHelper
static getObjectManager()
◆ testEmulateQuote()
@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 @magentoConfigFixture current_store persistent/options/shopping_cart 1 @magentoConfigFixture current_store persistent/options/logout_clear 0
Definition at line 78 of file EmulateQuoteObserverTest.php.
80 $requestMock = $this->getMockBuilder(
82 )->disableOriginalConstructor()->setMethods(
85 $requestMock->expects($this->once())->method(
'getFullActionName')->will($this->returnValue(
'valid_action'));
86 $event = new \Magento\Framework\Event([
'request' => $requestMock]);
87 $observer = new \Magento\Framework\Event\Observer();
90 $this->_customerSession->loginById(1);
92 $customer = $this->customerRepository->getById(
93 $this->_persistentSessionHelper->getSession()->getCustomerId()
95 $this->_checkoutSession->expects($this->once())->method(
'setCustomerData')->with(
$customer);
96 $this->_customerSession->logout();
◆ $_checkoutSession
◆ $_customerSession
◆ $_objectManager
◆ $_observer
◆ $_persistentSessionHelper
$_persistentSessionHelper |
|
protected |
◆ $customerRepository
The documentation for this class was generated from the following file: