mirror of
https://gitee.com/ShopeX/ECShopX
synced 2026-08-05 03:35:50 +08:00
4.7.0
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\ShuyunOpenPlatform;
|
||||
|
||||
use ShuyunOpenPlatformBundle\Services\ShuyunOpenPlatformOrderPlatformResolver;
|
||||
|
||||
class ShuyunOpenPlatformOrderPlatformResolverTest extends \TestCase
|
||||
{
|
||||
public function testShopadminResolvesToOffline(): void
|
||||
{
|
||||
config(['shuyun_open_platform.default_plat_code' => 'SHOULD_NOT_USE_FOR_SHOPADMIN']);
|
||||
$r = new ShuyunOpenPlatformOrderPlatformResolver();
|
||||
$this->assertSame('offline', $r->resolvePlatformHeaderForOrderClass('shopadmin'));
|
||||
$this->assertSame('offline', $r->resolvePlatformHeaderForOrderClass(' ShopAdmin '));
|
||||
}
|
||||
|
||||
public function testNonShopadminUsesDefaultPlatCodeLowercased(): void
|
||||
{
|
||||
config(['shuyun_open_platform.default_plat_code' => ' MyPlat ']);
|
||||
$r = new ShuyunOpenPlatformOrderPlatformResolver();
|
||||
$this->assertSame('offline', $r->resolvePlatformHeaderForOrderClass('wxapp'));
|
||||
$this->assertSame('offline', $r->resolvePlatformHeaderForOrderClass('pointsmall'));
|
||||
}
|
||||
|
||||
public function testEmptyDefaultPlatFallsBackToOffline(): void
|
||||
{
|
||||
config(['shuyun_open_platform.default_plat_code' => ' ']);
|
||||
$r = new ShuyunOpenPlatformOrderPlatformResolver();
|
||||
$this->assertSame('offline', $r->resolvePlatformHeaderForOrderClass('wxapp'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user