Пример #1
0
 protected function setUp()
 {
     parent::setUp();
     $quote = new Mage_Sales_Model_Quote();
     $quote->load('test01', 'reserved_order_id');
     Mage::getSingleton('Mage_Checkout_Model_Session')->setQuoteId($quote->getId());
 }
Пример #2
0
 /**
  * @magentoDataFixture Mage/Sales/_files/quote.php
  * @magentoDataFixture Mage/Paypal/_files/quote_payment.php
  */
 public function testReviewAction()
 {
     $quote = new Mage_Sales_Model_Quote();
     $quote->load('test01', 'reserved_order_id');
     Mage::getSingleton('Mage_Checkout_Model_Session')->setQuoteId($quote->getId());
     $this->dispatch('paypal/express/review');
     $html = $this->getResponse()->getBody();
     $this->assertContains('Simple Product', $html);
     $this->assertContains('Review', $html);
     $this->assertContains('/paypal/express/placeOrder/', $html);
 }
 /**
  * Covers app/code/core/Mage/Checkout/Block/Multishipping/Payment/Info.php
  * and app/code/core/Mage/Checkout/Block/Multishipping/Overview.php
  *
  * @magentoDataFixture Mage/Sales/_files/quote.php
  * @magentoDataFixture Mage/Customer/_files/customer.php
  */
 public function testOverviewAction()
 {
     $quote = new Mage_Sales_Model_Quote();
     $quote->load('test01', 'reserved_order_id');
     Mage::getSingleton('Mage_Checkout_Model_Session')->setQuoteId($quote->getId());
     $session = new Mage_Customer_Model_Session();
     $session->login('*****@*****.**', 'password');
     $this->getRequest()->setPost('payment', array('method' => 'checkmo'));
     $this->dispatch('checkout/multishipping/overview');
     $html = $this->getResponse()->getBody();
     $this->assertContains('<p>' . $quote->getPayment()->getMethodInstance()->getTitle() . '</p>', $html);
     $this->assertContains('<span class="price">$10.00</span>', $html);
 }
Пример #4
0
 /**
  * @magentoDataFixture Mage/Catalog/_files/product_virtual.php
  * @magentoDataFixture Mage/Sales/_files/quote.php
  */
 public function testCollectTotalsWithVirtual()
 {
     $quote = new Mage_Sales_Model_Quote();
     $quote->load('test01', 'reserved_order_id');
     $product = new Mage_Catalog_Model_Product();
     $product->load(21);
     $quote->addProduct($product);
     $quote->collectTotals();
     $this->assertEquals(2, $quote->getItemsQty());
     $this->assertEquals(1, $quote->getVirtualItemsQty());
     $this->assertEquals(20, $quote->getGrandTotal());
     $this->assertEquals(20, $quote->getBaseGrandTotal());
 }
Пример #5
0
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    Magento
 * @package     Mage_Paypal
 * @subpackage  integration_tests
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
$quote = new Mage_Sales_Model_Quote();
$quote->load('test01', 'reserved_order_id');
$payment = $quote->getPayment();
$payment->setMethod(Mage_Paypal_Model_Config::METHOD_WPP_EXPRESS);
$payment->setAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_PAYER_ID, 123);
$quote->collectTotals()->save();