/**
  * Test case for oePayPalOrderPayment::oePayPalOrderPaymentList()
  * Gets PayPal Order Payment history list
  *
  * @return null
  */
 public function testLoadOrderPayments()
 {
     $oOrderPayment = new oePayPalOrderPayment();
     $oOrderPayment->setPaymentId(1);
     $oOrderPayment->setOrderId("123");
     $oOrderPayment->setAmount(50);
     $oOrderPayment->setAction("OEPAYPAL_STATUS_COMPLETED");
     $oOrderPayment->setDate("2012-04-13 12:13:15");
     $oOrderPayment->save();
     $oOrderPayment->setPaymentId(2);
     $oOrderPayment->setDate("2012-02-01");
     $oOrderPayment->save();
     $oOrderPayment->setPaymentId(3);
     $oOrderPayment->setDate("2012-01-15");
     $oOrderPayment->save();
     $oOrderPaymentList = new oePayPalOrderPaymentList();
     $oOrderPaymentList->load("123");
     $this->assertEquals(3, count($oOrderPaymentList));
     $i = 1;
     foreach ($oOrderPaymentList as $oOrderPayment) {
         $this->assertEquals($i++, $oOrderPayment->getPaymentId());
     }
 }
 /**
  * Wrapper to create order payment.
  *
  * @param string $sTransactionId     transaction id.
  * @param bool   $blValid            if payment should be marked as not valid.
  * @param string $sValidationMessage validation message
  *
  * @return oePayPalOrderPayment
  */
 protected function _prepareOrderPayment($sTransactionId, $blValid = true, $sValidationMessage = '')
 {
     $oOrderPayment = new oePayPalOrderPayment();
     $oOrderPayment->setPaymentId('__a24das5das45');
     $oOrderPayment->setOrderId('_sOrderId');
     $oOrderPayment->setTransactionId($sTransactionId);
     if (!$blValid) {
         $oOrderPayment->setIsValid(false);
     }
     if ($sValidationMessage) {
         $sDate = date('Y-m-d H:i:s', oxRegistry::get("oxUtilsDate")->getTime());
         $oOrderPayment->addComment($sDate, $sValidationMessage);
     }
     return $oOrderPayment;
 }