Ejemplo n.º 1
0
 /**
  * @dataProvider mockProvider
  * @param Payout $obj
  */
 public function testCreate($obj, $mockApiContext)
 {
     $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(PayoutBatchTest::getJson()));
     $params = array();
     $result = $obj->create($params, $mockApiContext, $mockPPRestCall);
     $this->assertNotNull($result);
 }
Ejemplo n.º 2
0
 public function testCreate()
 {
     $request = $this->operation['request']['body'];
     $obj = new Payout($request);
     if (Setup::$mode != 'mock') {
         $obj->getSenderBatchHeader()->setSenderBatchId(uniqid());
     }
     PayoutsFunctionalTest::$batchId = $obj->getSenderBatchHeader()->getSenderBatchId();
     $params = array('sync_mode' => 'true');
     $result = $obj->create($params, null, $this->mockPayPalRestCall);
     $this->assertNotNull($result);
     $this->assertEquals(PayoutsFunctionalTest::$batchId, $result->getBatchHeader()->getSenderBatchHeader()->getSenderBatchId());
     return $result;
 }
Ejemplo n.º 3
0
 public function testCreate()
 {
     $request = $this->operation['request']['body'];
     $obj = new Payout($request);
     if (Setup::$mode != 'mock') {
         $obj->getSenderBatchHeader()->setSenderBatchId(uniqid());
     }
     PayoutsFunctionalTest::$batchId = $obj->getSenderBatchHeader()->getSenderBatchId();
     $params = array('sync_mode' => 'true');
     $result = $obj->create($params, $this->apiContext, $this->mockPayPalRestCall);
     $this->assertNotNull($result);
     $this->assertEquals(PayoutsFunctionalTest::$batchId, $result->getBatchHeader()->getSenderBatchHeader()->getSenderBatchId());
     $this->assertEquals('SUCCESS', $result->getBatchHeader()->getBatchStatus());
     $items = $result->getItems();
     $this->assertTrue(sizeof($items) > 0);
     $item = $items[0];
     $this->assertEquals('UNCLAIMED', $item->getTransactionStatus());
     return $result;
 }