PayPal\Test\Functional\Api\BillingAgreementsFunctionalTest::testExecute PHP Method

testExecute() public method

public testExecute ( $agreement ) : PayPal\Api\Agreement
$agreement Agreement
return PayPal\Api\Agreement
    public function testExecute($agreement)
    {
        if (Setup::$mode == 'sandbox') {
            $this->markTestSkipped('Not executable on sandbox environment. Needs human interaction');
        }
        $links = $agreement->getLinks();
        $url = parse_url($links[0]->getHref(), 6);
        parse_str($url, $result);
        $paymentToken = $result['token'];
        $this->assertNotNull($paymentToken);
        $this->assertNotEmpty($paymentToken);
        $result = $agreement->execute($paymentToken, $this->apiContext, $this->mockPayPalRestCall);
        return $result;
    }