mirror of
https://gitee.com/yansongda/pay.git
synced 2024-11-30 11:17:43 +08:00
33 lines
791 B
PHP
33 lines
791 B
PHP
<?php
|
|
|
|
namespace Yansongda\Pay\Tests;
|
|
|
|
use Yansongda\Pay\Contracts\GatewayApplicationInterface;
|
|
use Yansongda\Pay\Exceptions\InvalidGatewayException;
|
|
use Yansongda\Pay\Pay;
|
|
|
|
class PayTest extends TestCase
|
|
{
|
|
public function testAlipayGateway()
|
|
{
|
|
$alipay = Pay::alipay(['foo' => 'bar']);
|
|
|
|
$this->assertInstanceOf(GatewayApplicationInterface::class, $alipay);
|
|
}
|
|
|
|
public function testWechatGateway()
|
|
{
|
|
$wechat = Pay::wechat(['foo' => 'bar']);
|
|
|
|
$this->assertInstanceOf(GatewayApplicationInterface::class, $wechat);
|
|
}
|
|
|
|
public function testFooGateway()
|
|
{
|
|
$this->expectException(InvalidGatewayException::class);
|
|
$this->expectExceptionMessage('INVALID_GATEWAY: Gateway [foo] Not Exists');
|
|
|
|
Pay::foo([]);
|
|
}
|
|
}
|