function testCancelRelease_fromEscrowFailsIfTransactionNotSubmittedForRelease() { $transaction = $this->createEscrowedTransaction(); $result = Braintree_Transaction::cancelRelease($transaction->id); $this->assertFalse($result->success); $errors = $result->errors->forKey('transaction')->onAttribute('base'); $this->assertEquals(Braintree_Error_Codes::TRANSACTION_CANNOT_CANCEL_RELEASE, $errors[0]->code); }