public function testCancel($agreement)
{
$agreementStateDescriptor = new AgreementStateDescriptor($this->operation['request']['body']);
$result = $agreement->cancel($agreementStateDescriptor, $this->apiContext, $this->mockPayPalRestCall);
$this->assertTrue($result);
$this->setupTest($this->getClassName(), 'testGetCancelled');
$get = $this->testGet($agreement);
$this->assertEquals('Cancelled', $get->getState());
return $get;
}