Example #1
0
 public function assert404NotFound()
 {
     parent::assert404NotFound();
     /** @var $objectManager \Magento\TestFramework\ObjectManager */
     $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
     $this->assertNull($objectManager->get('Magento\\Framework\\Registry')->registry('current_category'));
 }
Example #2
0
 /**
  * Execute per test initialization.
  */
 public function setUp()
 {
     parent::setUp();
     $this->layout = Bootstrap::getObjectManager()->get('Magento\\Framework\\View\\LayoutInterface');
     $this->customerGroupService = Bootstrap::getObjectManager()->create('Magento\\Customer\\Service\\V1\\CustomerGroupService');
     $this->registry = Bootstrap::getObjectManager()->get('Magento\\Framework\\Registry');
 }
 protected function setUp()
 {
     /* Called getConfig as workaround for setConfig bug */
     \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore('default')->getConfig('dev/translate_inline/active');
     \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\Config\\MutableScopeConfigInterface')->setValue('dev/translate_inline/active', true, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, 'default');
     parent::setUp();
 }
Example #4
0
 protected function setUp()
 {
     parent::setUp();
     $quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Sales\\Model\\Quote');
     $quote->load('test01', 'reserved_order_id');
     \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Checkout\\Model\\Session')->setQuoteId($quote->getId());
 }
Example #5
0
 protected function setUp()
 {
     parent::setUp();
     /** @var $objectManager \Magento\TestFramework\ObjectManager */
     $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
     $this->productRepository = $objectManager->create('Magento\\Catalog\\Model\\ProductRepository');
 }
Example #6
0
 /**
  * Execute per test initialization.
  */
 public function setUp()
 {
     parent::setUp();
     $this->layout = Bootstrap::getObjectManager()->get('Magento\\Framework\\View\\LayoutInterface');
     $this->groupRepository = Bootstrap::getObjectManager()->create('Magento\\Customer\\Api\\GroupRepositoryInterface');
     $this->groupManagement = Bootstrap::getObjectManager()->create('Magento\\Customer\\Api\\GroupManagementInterface');
     $this->registry = Bootstrap::getObjectManager()->get('Magento\\Framework\\Registry');
 }
Example #7
0
 protected function setUp()
 {
     parent::setUp();
     $logger = $this->getMock('Psr\\Log\\LoggerInterface', [], [], '', false);
     $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Customer\\Model\\Session', [$logger]);
     $this->accountManagement = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Customer\\Api\\AccountManagementInterface');
     $customer = $this->accountManagement->authenticate('*****@*****.**', 'password');
     $session->setCustomerDataAsLoggedIn($customer);
 }
 protected function setUp()
 {
     parent::setUp();
     $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
     $this->customerSession = $objectManager->get('Magento\\Customer\\Model\\Session');
     $this->customerSession->setCustomerId(1);
     $this->coreSession = $objectManager->get('Magento\\Framework\\Session\\Generic');
     $this->coreSession->setData('_form_key', 'formKey');
 }
Example #9
0
 /**
  * @inheritdoc
  */
 public function setUp()
 {
     parent::setUp();
     $this->quote = $this->_objectManager->create('Magento\\Quote\\Model\\Quote');
     $this->checkoutSession = $this->_objectManager->get('Magento\\Checkout\\Model\\Session');
     $this->quote->load('test01', 'reserved_order_id');
     $this->checkoutSession->setQuoteId($this->quote->getId());
     $this->checkoutSession->setCartWasUpdated(false);
 }
Example #10
0
 protected function setUp()
 {
     parent::setUp();
     $logger = $this->getMock('Magento\\Framework\\Logger', array(), array(), '', false);
     $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Customer\\Model\\Session', array($logger));
     $service = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Customer\\Service\\V1\\CustomerAccountService');
     $customer = $service->authenticate('*****@*****.**', 'password');
     $session->setCustomerDataAsLoggedIn($customer);
 }
 protected function setUp()
 {
     parent::setUp();
     $order = $this->_objectManager->create('Magento\\Sales\\Model\\Order');
     $order->load('100000001', 'increment_id');
     $order->getPayment()->setMethod(\Magento\Paypal\Model\Config::METHOD_PAYFLOWADVANCED);
     $quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Quote\\Model\\Quote')->setStoreId($order->getStoreId())->save();
     $order->setQuoteId($quote->getId());
     $order->save();
     $session = $this->_objectManager->create('Magento\\Checkout\\Model\\Session');
     $session->setLastRealOrderId($order->getRealOrderId())->setLastQuoteId($order->getQuoteId());
 }
Example #12
0
 protected function tearDown()
 {
     $this->_customerSession->logout();
     $this->_customerSession = null;
     parent::tearDown();
 }
Example #13
0
 protected function tearDown()
 {
     $this->_session = null;
     $this->_auth = null;
     parent::tearDown();
 }
 protected function setUp()
 {
     parent::setUp();
 }
 /**
  * Utilize backend session model by default
  *
  * @param \PHPUnit_Framework_Constraint $constraint
  * @param string|null $messageType
  * @param string $messageManagerClass
  */
 public function assertSessionMessages(\PHPUnit_Framework_Constraint $constraint, $messageType = null, $messageManagerClass = 'Magento\\Framework\\Message\\Manager')
 {
     parent::assertSessionMessages($constraint, $messageType, $messageManagerClass);
 }
 public function setUp()
 {
     parent::setUp();
     $this->_objectManager->configure(['preferences' => ['Magento\\Framework\\App\\Response\\Http' => 'Magento\\Framework\\App\\Response\\Http\\Interceptor']]);
     $this->interceptedResponse = $this->_objectManager->create('\\Magento\\Framework\\App\\Response\\Http');
 }
Example #17
0
 protected function setUp()
 {
     parent::setUp();
     $this->_order = $this->_objectManager->create('Magento\\Sales\\Model\\Order');
     $this->_session = $this->_objectManager->get('Magento\\Checkout\\Model\\Session');
 }