Update Laravel to v12
Some checks failed
PHP Unit / PHPUnit test suite (pull_request) Has been cancelled
Laravel Pint / Laravel Pint (pull_request) Has been cancelled

This commit is contained in:
Jonny Barnes 2025-03-01 15:00:41 +00:00
parent f2025b801b
commit 1dfa17abca
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
83 changed files with 1324 additions and 2323 deletions

View file

@ -5,25 +5,26 @@ declare(strict_types=1);
namespace Tests\Feature\Admin;
use App\Models\User;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;
class AdminTest extends TestCase
{
/** @test */
#[Test]
public function adminPageRedirectsUnauthorisedUsersToLoginPage(): void
{
$response = $this->get('/admin');
$response->assertRedirect('/login');
}
/** @test */
#[Test]
public function loginPageLoads(): void
{
$response = $this->get('/login');
$response->assertViewIs('login');
}
/** @test */
#[Test]
public function loginAttemptWithBadCredentialsFails(): void
{
$response = $this->post('/login', [
@ -33,7 +34,7 @@ class AdminTest extends TestCase
$response->assertRedirect('/login');
}
/** @test */
#[Test]
public function loginSucceeds(): void
{
User::factory([
@ -49,7 +50,7 @@ class AdminTest extends TestCase
$response->assertRedirect('/admin');
}
/** @test */
#[Test]
public function whenLoggedInRedirectsToAdminPage(): void
{
$user = User::factory()->create();
@ -57,14 +58,14 @@ class AdminTest extends TestCase
$response->assertRedirect('/');
}
/** @test */
#[Test]
public function loggedOutUsersSimplyRedirected(): void
{
$response = $this->get('/logout');
$response->assertRedirect('/');
}
/** @test */
#[Test]
public function loggedInUsersShownLogoutForm(): void
{
$user = User::factory()->create();
@ -72,7 +73,7 @@ class AdminTest extends TestCase
$response->assertViewIs('logout');
}
/** @test */
#[Test]
public function loggedInUsersCanLogout(): void
{
$user = User::factory()->create();