Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/MageTest/Manager/Builders/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ public function build()

$this->model->getPayment()->importData(array('method' => $this->attributes['payment_method']));

$attributes = $this->attributes;
unset($attributes['payment_method']);
unset($attributes['shipping_method']);

$this->model->addData($attributes);

$this->model->collectTotals()->save();

\Mage::app()->getStore()->setConfig(\Mage_Sales_Model_Order::XML_PATH_EMAIL_ENABLED, '0');
Expand Down
3 changes: 2 additions & 1 deletion src/MageTest/Manager/Fixtures/Order.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sales/quote (customer/address catalog/product):
shipping_method: flatrate_flatrate
payment_method: checkmo
payment_method: checkmo
customer_email: test@example.com
5 changes: 5 additions & 0 deletions tests/MageTest/Manager/OrderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ public function testDeleteOrderWithOneProduct()
$session->visit(getenv('BASE_URL') . '/admin/sales_order/index');
$this->assertSession()->pageTextNotContains($this->orderFixture->getIncrementId());
}

public function testOrderAttributeAssignment()
{
$this->assertNotFalse(filter_var($this->orderFixture->getCustomerEmail(), FILTER_VALIDATE_EMAIL));
}
}