Update ResourceTest.php

This commit is contained in:
Dan Harrin
2024-07-30 14:12:22 +01:00
committed by GitHub
parent e358d9dce8
commit 322cc8d12f
+6 -6
View File
@@ -105,17 +105,17 @@ it('can retrieve a page\'s URL', function () {
->toContain(strval($post->getRouteKey()));
});
it('can retrieve page urls by models', function () {
it('can retrieve a page\'s URL from its model', function () {
$post = Post::factory()->create();
expect(Filament::getResourceUrl($post, 'edit'))
->toEndWith('/posts/' . $post->getKey() . '/edit');
->toEndWith("/posts/{$post->getKey(}/edit");
expect(Filament::getResourceUrl($post, 'view'))
->toEndWith('/posts/' . $post->getKey());
->toEndWith("/posts/{$post->getKey()}");
expect(Filament::getResourceUrl(Post::class, 'view', ['record' => $post]))
->toEndWith('/posts/' . $post->getKey());
->toEndWith("/posts/{$post->getKey()}");
expect(Filament::getResourceUrl(Post::class))
->toEndWith('/posts');
->toEndWith("/posts");
expect(Filament::getResourceUrl($post))
->toEndWith('/posts');
->toEndWith("/posts");
});