Update to Laravel 12
This commit is contained in:
parent
b30973d0fe
commit
736b0ea831
82 changed files with 683 additions and 720 deletions
|
@ -6,6 +6,7 @@ namespace Tests\Feature;
|
|||
|
||||
use App\Models\Note;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use Tests\TestCase;
|
||||
|
||||
class NotesControllerTest extends TestCase
|
||||
|
@ -15,9 +16,8 @@ class NotesControllerTest extends TestCase
|
|||
/**
|
||||
* Test the `/notes` page returns 200, this should
|
||||
* mean the database is being hit.
|
||||
*
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function notesPageLoads(): void
|
||||
{
|
||||
$response = $this->get('/notes');
|
||||
|
@ -26,9 +26,8 @@ class NotesControllerTest extends TestCase
|
|||
|
||||
/**
|
||||
* Test a specific note.
|
||||
*
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function specificNotePageLoads(): void
|
||||
{
|
||||
$note = Note::factory()->create();
|
||||
|
@ -46,9 +45,8 @@ class NotesControllerTest extends TestCase
|
|||
|
||||
/**
|
||||
* Test that `/note/{decID}` redirects to `/notes/{nb60id}`.
|
||||
*
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function oldNoteUrlsRedirect(): void
|
||||
{
|
||||
$note = Note::factory()->create();
|
||||
|
@ -58,23 +56,22 @@ class NotesControllerTest extends TestCase
|
|||
|
||||
/**
|
||||
* Visit the tagged page and check the tag view data.
|
||||
*
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function taggedNotesPageLoads(): void
|
||||
{
|
||||
$response = $this->get('/notes/tagged/beer');
|
||||
$response->assertViewHas('tag', 'beer');
|
||||
}
|
||||
|
||||
/** @test */
|
||||
#[Test]
|
||||
public function unknownNoteGives404(): void
|
||||
{
|
||||
$response = $this->get('/notes/112233');
|
||||
$response->assertNotFound();
|
||||
}
|
||||
|
||||
/** @test */
|
||||
#[Test]
|
||||
public function checkNoteIdNotOutOfRange(): void
|
||||
{
|
||||
$response = $this->get('/notes/photou-photologo');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue