Files
ECShopX/tests/StoreHomePageAccessTest.php
wanghai e24f7d77b5 4.6.0
2026-05-15 16:44:39 +08:00

27 lines
802 B
PHP

<?php
use Dingo\Api\Exception\ResourceException;
use EmployeePurchaseBundle\Services\StoreHomePageAccess;
use PHPUnit\Framework\TestCase;
final class StoreHomePageAccessTest extends TestCase
{
public function testDealerMismatchThrows(): void
{
$this->expectException(ResourceException::class);
StoreHomePageAccess::assertRowMatchesDealer(['distributor_id' => 10], 99);
}
public function testDealerMatchOk(): void
{
$this->expectNotToPerformAssertions();
StoreHomePageAccess::assertRowMatchesDealer(['distributor_id' => 10], 10);
}
public function testZeroAuthDistributorSkipsDealerCheck(): void
{
$this->expectNotToPerformAssertions();
StoreHomePageAccess::assertRowMatchesDealer(['distributor_id' => 10], 0);
}
}