pay/tests/PayTest.php
2019-08-31 11:49:37 +08:00

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([]);
}
}