-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace InvalidArgumentException with ParameterValidationException
The commit includes the replacement of all instances of InvalidArgumentException with ParameterValidationException in the setMInfo function of the Request class. Due to this change, the relevant unit tests have also been updated to expect ParameterValidationException instead of InvalidArgumentException.
- Loading branch information
1 parent
46242d0
commit 64e2b80
Showing
2 changed files
with
13 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,14 @@ | |
namespace VenelinIliev\Borica3ds\Tests\Unit; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use VenelinIliev\Borica3ds\Exceptions\ParameterValidationException; | ||
use VenelinIliev\Borica3ds\SaleRequest; | ||
|
||
class SaleRequestMInfoTest extends TestCase | ||
{ | ||
/** | ||
* @throws ParameterValidationException | ||
*/ | ||
public function testGetMInfo() | ||
{ | ||
$request = new SaleRequest(); | ||
|
@@ -27,7 +31,7 @@ public function testGetMInfo() | |
|
||
public function testMInfoWithInvalidEmail() | ||
{ | ||
$this->expectException(\InvalidArgumentException::class); | ||
$this->expectException(ParameterValidationException::class); | ||
|
||
$request = new SaleRequest(); | ||
$request->setMInfo([ | ||
|
@@ -38,7 +42,7 @@ public function testMInfoWithInvalidEmail() | |
|
||
public function testMInfoWithInvalidCardholderNameLength() | ||
{ | ||
$this->expectException(\InvalidArgumentException::class); | ||
$this->expectException(ParameterValidationException::class); | ||
|
||
$request = new SaleRequest(); | ||
$request->setMInfo([ | ||
|
@@ -49,15 +53,15 @@ public function testMInfoWithInvalidCardholderNameLength() | |
|
||
public function testMInfoWithMissingRequiredFields() | ||
{ | ||
$this->expectException(\InvalidArgumentException::class); | ||
$this->expectException(ParameterValidationException::class); | ||
|
||
$request = new SaleRequest(); | ||
$request->setMInfo(['email' => '[email protected]']); | ||
} | ||
|
||
public function testMInfoWithInvalidMobilePhoneStructure() | ||
{ | ||
$this->expectException(\InvalidArgumentException::class); | ||
$this->expectException(ParameterValidationException::class); | ||
|
||
$request = new SaleRequest(); | ||
$request->setMInfo([ | ||
|