public function testForm()
 {
     $order = $this->objFromFixture("Order", "unpaid");
     OrderManipulation::add_session_order($order);
     $controller = new CheckoutPage_Controller($this->objFromFixture("CheckoutPage", "checkout"));
     $form = new OrderActionsForm($controller, "ActionsForm", $order);
     $form->dopayment(array('OrderID' => $order->ID, 'PaymentMethod' => 'Dummy'), $form);
     $this->assertEquals(1, $order->Payments()->count());
 }
 /**
  * Build a form for cancelling, or retrying payment for a placed order.
  * @return Form
  */
 public function ActionsForm()
 {
     if ($order = $this->orderfromid()) {
         $form = new OrderActionsForm($this->owner, "ActionsForm", $order);
         $form->extend('updateActionsForm', $order);
         if (!$form->Actions()->exists()) {
             return null;
         }
         return $form;
     }
 }