Skip to content

Commit

Permalink
Fixed tests #180 & Resolved #184
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Apr 26, 2019
1 parent 6f220c2 commit 66a8d7e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/Gateways/ChuanglanGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ public function testBuildEndpoint()
$config = ['channel' => ChuanglanGateway::CHANNEL_VALIDATE_CODE];
$config = new Config($config);
$endpoint = 'https://smsbj1.253.com/msg/send/json';
$this->assertSame($endpoint, $method->invoke($gateway, $config));
$this->assertSame($endpoint, $method->invoke($gateway, $config, 86));

// 营销通道
$config = ['channel' => ChuanglanGateway::CHANNEL_PROMOTION_CODE];
$config = new Config($config);
$endpoint = 'https://smssh1.253.com/msg/send/json';
$this->assertSame($endpoint, $method->invoke($gateway, $config));
$this->assertSame($endpoint, $method->invoke($gateway, $config, 86));
}

/**
Expand All @@ -168,12 +168,12 @@ public function testGetChannel()
// 验证码通道
$config = ['channel' => ChuanglanGateway::CHANNEL_VALIDATE_CODE];
$config = new Config($config);
$this->assertSame(ChuanglanGateway::CHANNEL_VALIDATE_CODE, $method->invoke($gateway, $config));
$this->assertSame(ChuanglanGateway::CHANNEL_VALIDATE_CODE, $method->invoke($gateway, $config, 86));

// 营销通道
$config = ['channel' => ChuanglanGateway::CHANNEL_PROMOTION_CODE];
$config = new Config($config);
$this->assertSame(ChuanglanGateway::CHANNEL_PROMOTION_CODE, $method->invoke($gateway, $config));
$this->assertSame(ChuanglanGateway::CHANNEL_PROMOTION_CODE, $method->invoke($gateway, $config, 86));
}

/**
Expand All @@ -192,7 +192,7 @@ public function testGetChannelException()
$this->expectExceptionMessage('Invalid channel for ChuanglanGateway.');
$config = ['channel' => 'error'];
$config = new Config($config);
$method->invoke($gateway, $config);
$method->invoke($gateway, $config, 86);
}

/**
Expand All @@ -211,7 +211,7 @@ public function testValidateCodeChannelWrapChannelContent()
// 验证码通道
$config = ['channel' => ChuanglanGateway::CHANNEL_VALIDATE_CODE];
$config = new Config($config);
$this->assertSame('这是短信内容。', $method->invoke($gateway, $content, $config));
$this->assertSame('这是短信内容。', $method->invoke($gateway, $content, $config, 86));
}

/**
Expand All @@ -234,7 +234,7 @@ public function testPromotionChannelWrapChannelContent()
'unsubscribe' => '回TD退订',
];
$config = new Config($config);
$this->assertSame('【通讯云】这是短信内容。回TD退订', $method->invoke($gateway, $content, $config));
$this->assertSame('【通讯云】这是短信内容。回TD退订', $method->invoke($gateway, $content, $config, 86));
}

/**
Expand All @@ -259,7 +259,7 @@ public function testPromotionChannelWrapChannelContentWithoutSign()
'unsubscribe' => '回TD退订',
];
$config = new Config($config);
$method->invoke($gateway, $content, $config);
$method->invoke($gateway, $content, $config, 86);
}

/**
Expand All @@ -284,6 +284,6 @@ public function testPromotionChannelWrapChannelContentWithoutUnsubscribe()
'unsubscribe' => '',
];
$config = new Config($config);
$method->invoke($gateway, $content, $config);
$method->invoke($gateway, $content, $config, 86);
}
}

0 comments on commit 66a8d7e

Please sign in to comment.