mirror of
https://gitee.com/ShopeX/ECShopX
synced 2026-06-28 19:15:36 +08:00
27 lines
802 B
PHP
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);
|
|
}
|
|
}
|