Skip to content

Commit d5d60ea

Browse files
authored
Tests (#2)
* Install Pest via Composer * Set up Pest * Add example User integration test * Add example Home Inertia feature controller test * Update DatabaseSeeder.php * Add seeding for users in app and tests
1 parent 6548b30 commit d5d60ea

File tree

14 files changed

+849
-68
lines changed

14 files changed

+849
-68
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Inertia\Inertia;
6+
7+
class HomeController extends Controller
8+
{
9+
public function index()
10+
{
11+
return Inertia::render('Index');
12+
}
13+
}

app/Providers/RouteServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class RouteServiceProvider extends ServiceProvider
1717
*
1818
* @var string
1919
*/
20-
public const HOME = '/home';
20+
public const HOME = '/';
2121

2222
/**
2323
* Define your route model bindings, pattern filters, and other route configuration.

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
"laravel/sail": "^1.0.1",
1919
"mockery/mockery": "^1.4.4",
2020
"nunomaduro/collision": "^6.1",
21+
"pestphp/pest": "^1.22",
22+
"pestphp/pest-plugin-laravel": "^1.3",
23+
"pestphp/pest-plugin-parallel": "^1.2",
2124
"phpunit/phpunit": "^9.5.10",
22-
"spatie/laravel-ignition": "^1.0"
25+
"spatie/laravel-ignition": "^1.0",
26+
"spatie/ray": "^1.36"
2327
},
2428
"autoload": {
2529
"psr-4": {
@@ -49,6 +53,7 @@
4953
"build:test": [
5054
"composer install --no-interaction"
5155
],
56+
"test": "php artisan test --parallel --stop-on-failure",
5257
"post-autoload-dump": [
5358
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
5459
"@php artisan package:discover --ansi"

0 commit comments

Comments
 (0)