Skip to content

Commit

Permalink
Merge pull request #11 from totem-it/test
Browse files Browse the repository at this point in the history
test: Added new tests in `ArchTest`
  • Loading branch information
rudashi authored Dec 2, 2024
2 parents 2e2f5b9 + 176367d commit 3b93e1b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/ArchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

namespace Totem\SamSkeleton\Tests;

use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Http\Resources\Json\ResourceCollection;
use Totem\SamSkeleton\Bundles\Resource\ApiCollection;
use Totem\SamSkeleton\Bundles\Resource\ApiResource;
use Totem\SamSkeleton\SamSkeletonServiceProvider;

//arch()->preset()->php();

//arch()->preset()->security();
Expand All @@ -12,10 +18,30 @@
->expect('Totem\SamSkeleton')
->not->toUse(['die', 'dd', 'dump', 'var_dump']);

arch('no env()')
->expect('Totem\SamSkeleton')
->not()->toUse('env')
->ignoring(SamSkeletonServiceProvider::class);

arch('strict types')
->expect('Totem\SamSkeleton')
->toUseStrictTypes();

arch('strict equality')
->expect('Totem\SamSkeleton')
->toUseStrictEquality();

arch('Bundle Middleware')
->expect('Totem\SamSkeleton\Bundles\Middleware')
->toHaveMethod('handle')
->toHaveSuffix('Middleware');

describe('Bundle Resource', function (): void {
arch('resource')
->expect(ApiResource::class)
->toExtend(JsonResource::class);

arch('collection')
->expect(ApiCollection::class)
->toExtend(ResourceCollection::class);
});

0 comments on commit 3b93e1b

Please sign in to comment.