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

45 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace Tests\ShuyunOpenPlatform;
use ShuyunOpenPlatformBundle\Entities\CompanyShuyunOpenPlatformConfig;
use ShuyunOpenPlatformBundle\Services\ShuyunOpenPlatformShopSyncTargetPlatCodesResolver;
/** @see .tasks/plans/shuyun-offline-only.md TC-SHP-02 */
class ShuyunOpenPlatformShopSyncTargetPlatCodesResolverTest extends \TestCase
{
public function testVirtualShopEnabledResolvesOfflineOnly(): void
{
$resolver = new ShuyunOpenPlatformShopSyncTargetPlatCodesResolver();
$config = new CompanyShuyunOpenPlatformConfig();
$config->setPlatCode('MYPLAT');
$codes = $resolver->resolveForShopJob(
'ENABLED',
$config,
1,
99,
['distributor_id' => 99, 'distributor_self' => 1, 'is_valid' => 'true'],
);
$this->assertSame(['OFFLINE'], $codes);
}
public function testPhysicalShopClosedResolvesOfflineOnly(): void
{
$resolver = new ShuyunOpenPlatformShopSyncTargetPlatCodesResolver();
$codes = $resolver->resolveForShopJob(
'CLOSED',
null,
1,
10,
['distributor_id' => 10, 'is_valid' => 'closed'],
);
$this->assertSame(['OFFLINE'], $codes);
}
}