-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dca0fb2
commit 87109ef
Showing
7 changed files
with
47 additions
and
61 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 was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Omalizadeh\MultiPayment\Tests; | ||
|
||
use Omalizadeh\MultiPayment\Exceptions\InvalidConfigurationException; | ||
use Omalizadeh\MultiPayment\Facades\PaymentGateway; | ||
|
||
class PaymentGatewayConfigTest extends TestCase | ||
{ | ||
public function test_default_gateway_is_set_correctly(): void | ||
{ | ||
$this->assertEquals('zarinpal', PaymentGateway::getProviderName()); | ||
$this->assertEquals('main', PaymentGateway::getProviderInstanceConfigKey()); | ||
} | ||
|
||
public function test_gateway_can_be_changed(): void | ||
{ | ||
PaymentGateway::setProvider('zarinpal', 'other'); | ||
|
||
$this->assertEquals('zarinpal', PaymentGateway::getProviderName()); | ||
$this->assertEquals('other', PaymentGateway::getProviderInstanceConfigKey()); | ||
} | ||
|
||
public function test_invalid_gateway_config_throws_exception(): void | ||
{ | ||
$this->expectException(InvalidConfigurationException::class); | ||
|
||
PaymentGateway::setProvider('zarinpal', 'invalid_key'); | ||
} | ||
} |
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