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

39 lines
1.3 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* store-ops-buy-now-cloud-stockShopadminFastBuyCheckoutAddressValidator 单元测试可选工具类checkout 不再强制调用)。
*/
use CompanysBundle\Services\ShopadminFastBuyCheckoutAddressValidator;
use Dingo\Api\Exception\ResourceException;
class ShopadminFastBuyCheckoutAddressValidatorTest extends TestCase
{
public function testMissingReceiverThrows(): void
{
$this->expectException(ResourceException::class);
ShopadminFastBuyCheckoutAddressValidator::assertLogisticsAddressPresent([
'receiver_mobile' => '13800138000',
'receiver_zip' => '000000',
'receiver_state' => '浙江省',
'receiver_city' => '杭州市',
'receiver_district' => '西湖区',
'receiver_address' => '文三路 1 号',
]);
}
public function testFullAddressPasses(): void
{
ShopadminFastBuyCheckoutAddressValidator::assertLogisticsAddressPresent([
'receiver_name' => '张三',
'receiver_mobile' => '13800138000',
'receiver_zip' => '000000',
'receiver_state' => '浙江省',
'receiver_city' => '杭州市',
'receiver_district' => '西湖区',
'receiver_address' => '文三路 1 号',
]);
$this->addToAssertionCount(1);
}
}