Skip to content

Instantly share code, notes, and snippets.

View pleaz's full-sized avatar
🐊
Working from home

Anton pleaz

🐊
Working from home
View GitHub Profile
@pleaz
pleaz / BooksEndpointTest.php
Created April 16, 2024 21:09 — forked from filipfilipovich/BooksEndpointTest.php
Books API endpoint test file
<?php
use App\Models\Book;
const API_ENDPOINT = '/api/books';
uses()->group('books'); // Assign 'books' group to all tests (whole file)
beforeEach(function () {
$this->mockBooksCollection = Book::factory(5)->create(); // Generate mock database entries for testing