Ejemplo n.º 1
0
 public function testIssue18233()
 {
     // insert orders
     $orderData = array('account_identifier' => 'ez', 'created' => 130252369, 'data_text_1' => '\\<?xml ?\\>', 'email' => '*****@*****.**', 'productcollection_id' => '5', 'status_modifier_id' => '14', 'user_id' => 14);
     $order = new eZOrder($orderData);
     $order->store();
     $oldOrderNR = $order->attribute('order_nr');
     $order->activate();
     $this->assertEquals($oldOrderNR + 1, $order->attribute('id'));
     $this->assertEquals(0, $order->attribute('is_temporary'));
 }
Ejemplo n.º 2
0
 function createOrder()
 {
     // Make order
     $productCollectionID = $this->attribute('productcollection_id');
     $user = eZUser::currentUser();
     $userID = $user->attribute('contentobject_id');
     $time = time();
     $order = new eZOrder(array('productcollection_id' => $productCollectionID, 'user_id' => $userID, 'is_temporary' => 1, 'created' => $time, 'status_id' => eZOrderStatus::PENDING, 'status_modified' => $time, 'status_modifier_id' => $userID));
     $db = eZDB::instance();
     $db->begin();
     $order->store();
     $orderID = $order->attribute('id');
     $this->setAttribute('order_id', $orderID);
     $this->store();
     $db->commit();
     return $order;
 }