提交 b1d18155 编写于 作者: O overtrue

Fixed #167

上级 b57b9faf
......@@ -261,6 +261,10 @@ class EasySms
*/
protected function formatGatewayClassName($name)
{
if (\class_exists($name) && \in_array(GatewayInterface::class, \class_implements($name))) {
return $name;
}
$name = \ucfirst(\str_replace(['-', '_', ''], '', $name));
return __NAMESPACE__."\\Gateways\\{$name}Gateway";
......
......@@ -66,7 +66,7 @@ class EasySmsTest extends TestCase
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
sprintf(
'Class "%s" is a invalid easy-sms gateway.',
'Class "Overtrue\EasySms\Gateways\%sGateway" is a invalid easy-sms gateway.',
DummyInvalidGatewayForTest::class
)
);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册