PayPal\Test\Api\TemplateTest::getJson PHP Method

getJson() public static method

Gets Json String of Object Template
public static getJson ( ) : string
return string
    public static function getJson()
    {
        return '{"template_id":"TestSample","name":"TestSample","default":true,"template_data":' . TemplateDataTest::getJson() . ',"settings":' . TemplateSettingsTest::getJson() . ',"unit_of_measure":"TestSample","custom":true}';
    }

Usage Example

 /**
  * @dataProvider mockProvider
  * @param Templates $obj
  */
 public function testGet($obj, $mockApiContext)
 {
     $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(TemplateTest::getJson()));
     $result = $obj->get("templateId", $mockApiContext, $mockPPRestCall);
     $this->assertNotNull($result);
 }