mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-03 11:15:04 +02:00
35 lines
815 B
PHP
35 lines
815 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Http\Api\Scope\GlobalScope;
|
|
use App\Http\Api\Scope\RelationScope;
|
|
use App\Http\Api\Scope\TypeScope;
|
|
use Illuminate\Foundation\Testing\WithFaker;
|
|
|
|
uses(WithFaker::class);
|
|
|
|
test('global scope is within scope', function (): void {
|
|
$scope = new GlobalScope();
|
|
|
|
$otherScope = new GlobalScope();
|
|
|
|
$this->assertTrue($scope->isWithinScope($otherScope));
|
|
});
|
|
|
|
test('type scope is within scope', function (): void {
|
|
$scope = new GlobalScope();
|
|
|
|
$otherScope = new TypeScope(fake()->word());
|
|
|
|
$this->assertTrue($scope->isWithinScope($otherScope));
|
|
});
|
|
|
|
test('relation scope is within scope', function (): void {
|
|
$scope = new GlobalScope();
|
|
|
|
$otherScope = new RelationScope(fake()->word());
|
|
|
|
$this->assertTrue($scope->isWithinScope($otherScope));
|
|
});
|