getDefaultProperties(); expect($defaults['model'] ?? null)->toBe(Entry::class); expect($defaults['recordTitleAttribute'] ?? null)->toBe('title'); }); it('defines the expected pages', function () { $pages = EntryResource::getPages(); expect(array_keys($pages))->toEqual(['index', 'create', 'view', 'edit']); }); it('accepts new record when entered via the form schema', function () { $data = [ 'title' => 'Test Entry', 'slug' => 'test-entry', 'description' => 'This is a test entry.', 'is_published' => true, 'is_featured' => false, 'published_at' => now()->toDateString(), 'content' => '

This is the content of the test entry.

', ]; $entry = new Entry(); $entry->fill($data); expect($entry->slug)->toBe('test-entry'); }); it('deletes a record correctly', function () { $entry = Entry::create([ 'title' => 'Test Entry to Delete', 'slug' => 'test-entry-to-delete', 'description' => 'This is a test entry.', 'is_published' => false, 'is_featured' => false, 'published_at' => null, 'content' => '

This is the content of the test entry.

', ]); $entryId = $entry->id; $entry->delete(); $deletedEntry = Entry::find($entryId); expect($deletedEntry)->toBeNull(); });