forked from LiveCarta/PayPal-PHP-SDK
Adding \InvalidArgumentException tests to void() and reauthorize().
This commit is contained in:
@@ -143,6 +143,12 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase {
|
|||||||
$void = $auth->void();
|
$void = $auth->void();
|
||||||
$this->assertNotNull($void->getId());
|
$this->assertNotNull($void->getId());
|
||||||
|
|
||||||
|
$auth->setId(null);
|
||||||
|
try {
|
||||||
|
$auth->void();
|
||||||
|
} catch (\InvalidArgumentException $ex) {
|
||||||
|
$this->assertEquals($ex->getMessage(), "Id cannot be null");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testReauthorize() {
|
public function testReauthorize() {
|
||||||
@@ -154,9 +160,17 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase {
|
|||||||
|
|
||||||
$authorization->setAmount($amount);
|
$authorization->setAmount($amount);
|
||||||
try {
|
try {
|
||||||
$reauthorization = $authorization->reauthorize();
|
$authorization->reauthorize();
|
||||||
} catch (PPConnectionException $ex){
|
} catch (PPConnectionException $ex){
|
||||||
|
var_dump($ex->getMessage());
|
||||||
$this->assertEquals(strpos($ex->getMessage(),"500"), false);
|
$this->assertEquals(strpos($ex->getMessage(),"500"), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$authorization->setId(null);
|
||||||
|
try {
|
||||||
|
$authorization->reauthorize();
|
||||||
|
} catch (\InvalidArgumentException $ex) {
|
||||||
|
$this->assertEquals($ex->getMessage(), "Id cannot be null");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user