Files
ECShopX/tests/ShuyunOpenPlatform/ShuyunOpenPlatformOfflinePlatGatewaySuffixApplierTest.php
wanghai 058673559c 4.7.0
2026-06-26 19:20:24 +08:00

25 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace Tests\ShuyunOpenPlatform;
use ShuyunOpenPlatformBundle\Services\ShuyunOpenPlatformOfflinePlatGatewaySuffixApplier;
class ShuyunOpenPlatformOfflinePlatGatewaySuffixApplierTest extends \TestCase
{
public function testApplyDisplayNameSuffixUsesConfigAndSkipsDuplicate(): void
{
config(['shuyun_open_platform.offline_plat_name_suffix' => '-线下']);
$this->assertSame('类目A-线下', ShuyunOpenPlatformOfflinePlatGatewaySuffixApplier::applyDisplayNameSuffix('类目A'));
$this->assertSame('类目A-线下', ShuyunOpenPlatformOfflinePlatGatewaySuffixApplier::applyDisplayNameSuffix('类目A-线下'));
}
public function testApplyExternalIdSuffixUsesConfigAndSkipsDuplicate(): void
{
config(['shuyun_open_platform.offline_plat_id_suffix' => '-offline']);
$this->assertSame('100-offline', ShuyunOpenPlatformOfflinePlatGatewaySuffixApplier::applyExternalIdSuffix('100'));
$this->assertSame('100-offline', ShuyunOpenPlatformOfflinePlatGatewaySuffixApplier::applyExternalIdSuffix('100-offline'));
}
}