This commit is contained in:
wanghai
2026-05-15 16:44:39 +08:00
parent 72a9bbbb14
commit e24f7d77b5
65 changed files with 6530 additions and 285 deletions

View File

@@ -0,0 +1,26 @@
<?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);
}
}