/** * Test case for oePayPalOrderPayment::oePayPalOrderPaymentList() * Gets PayPal Order Payment history list * * @return null */ public function testLoadOrderPayments() { $oComment = new oePayPalOrderPaymentComment(); $oComment->setDate('2013-02-03 12:12:12'); $oComment->setComment('comment1'); $oComment->setPaymentId(2); $oComment->save(); $oComment = new oePayPalOrderPaymentComment(); $oComment->setDate('2013-02-03 12:12:12'); $oComment->setComment('comment2'); $oComment->setPaymentId(2); $oComment->save(); $aComments = new oePayPalOrderPaymentCommentList(); $aComments->load(2); $this->assertEquals(2, count($aComments)); $i = 1; foreach ($aComments as $oComment) { $this->assertEquals('comment' . $i++, $oComment->getComment()); } }
/** * Test case for oePayPalPayPalOrder::save() * Tests adding / getting PayPal Order Payment history item * * @return null */ public function testSavePayPalPayPalOrder_update() { $oComment = new oePayPalOrderPaymentComment(); $oComment->setCommentId(10); $oComment->setDate('2013-02-03 12:12:12'); $oComment->setComment('comment'); $oComment->setPaymentId(2); $oComment->save(); $oCommentLoaded = new oePayPalOrderPaymentComment(); $oCommentLoaded->load(10); $oCommentLoaded->setComment('comment comment'); $id = $oCommentLoaded->save(); $this->assertEquals(10, $id); $oCommentLoaded = new oePayPalOrderPaymentComment(); $oCommentLoaded->load(10); $this->assertEquals(10, $oCommentLoaded->getCommentId()); $this->assertEquals('comment comment', $oCommentLoaded->getComment()); $this->assertEquals(2, $oCommentLoaded->getPaymentId()); $this->assertEquals('2013-02-03 12:12:12', $oCommentLoaded->getDate()); }