mirror of
https://gitee.com/ShopeX/ECShopX
synced 2026-08-07 04:25:45 +08:00
4.6.0
This commit is contained in:
26
tests/StoreHomePageAccessTest.php
Normal file
26
tests/StoreHomePageAccessTest.php
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user