getObject() public static method

Gets Object Instance with Json data filled in
public static getObject ( ) : Capture
return PayPal\Api\Capture
Exemplo n.º 1
0
 /**
  * @depends testSerializationDeserialization
  * @param RelatedResources $obj
  */
 public function testGetters($obj)
 {
     $this->assertEquals($obj->getSale(), SaleTest::getObject());
     $this->assertEquals($obj->getAuthorization(), AuthorizationTest::getObject());
     $this->assertEquals($obj->getOrder(), OrderTest::getObject());
     $this->assertEquals($obj->getCapture(), CaptureTest::getObject());
     $this->assertEquals($obj->getRefund(), RefundTest::getObject());
 }
Exemplo n.º 2
0
 /**
  * @dataProvider mockProvider
  * @param Order $obj
  */
 public function testCapture($obj, $mockApiContext)
 {
     $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(CaptureTest::getJson()));
     $capture = CaptureTest::getObject();
     $result = $obj->capture($capture, $mockApiContext, $mockPPRestCall);
     $this->assertNotNull($result);
 }