This commit is contained in:
wanghai
2026-06-26 19:20:24 +08:00
parent 2e248de433
commit 058673559c
375 changed files with 34935 additions and 1361 deletions

View File

@@ -0,0 +1,21 @@
<?php
/**
* is_platform_store_buy 原始值解析(店务在售 / 立即购买)
*/
use DistributionBundle\Services\DistributorService;
class DistributorServicePlatformStoreBuyTest extends TestCase
{
public function testIsPlatformStoreBuyEnabledRaw(): void
{
$this->assertTrue(DistributorService::isPlatformStoreBuyEnabledRaw(['is_platform_store_buy' => true]));
$this->assertTrue(DistributorService::isPlatformStoreBuyEnabledRaw(['is_platform_store_buy' => 1]));
$this->assertTrue(DistributorService::isPlatformStoreBuyEnabledRaw(['is_platform_store_buy' => '1']));
$this->assertTrue(DistributorService::isPlatformStoreBuyEnabledRaw(['is_platform_store_buy' => 'true']));
$this->assertFalse(DistributorService::isPlatformStoreBuyEnabledRaw(['is_platform_store_buy' => false]));
$this->assertFalse(DistributorService::isPlatformStoreBuyEnabledRaw(['is_platform_store_buy' => 0]));
$this->assertFalse(DistributorService::isPlatformStoreBuyEnabledRaw([]));
}
}