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

@ -8,13 +8,14 @@ use App\Jobs\ProcessWebMention;
use App\Models\Note;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Queue;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;
class WebMentionsControllerTest extends TestCase
{
use RefreshDatabase;
/** @test */
#[Test]
public function webmentionEndpointCanServeBrowserRequest(): void
{
$response = $this->get('/webmention');
@ -23,9 +24,8 @@ class WebMentionsControllerTest extends TestCase
/**
* Test webmentions without source and target are rejected.
*
* @test
*/
#[Test]
public function webmentionsWithoutSourceAndTargetAreRejected(): void
{
$response = $this->call('POST', '/webmention', ['source' => 'https://example.org/post/123']);
@ -36,9 +36,8 @@ class WebMentionsControllerTest extends TestCase
* Test invalid target gives a 400 response.
*
* In this case an invalid target is a URL that doesnt exist on our domain.
*
* @test
*/
#[Test]
public function invalidTargetReturnsErrorResponse(): void
{
$response = $this->call('POST', '/webmention', [
@ -50,9 +49,8 @@ class WebMentionsControllerTest extends TestCase
/**
* Test blog target gets a 501 response due to our not supporting it.
*
* @test
*/
#[Test]
public function blogTargetReturns501Response(): void
{
$response = $this->call('POST', '/webmention', [
@ -64,9 +62,8 @@ class WebMentionsControllerTest extends TestCase
/**
* Test that a non-existent note gives a 400 response.
*
* @test
*/
#[Test]
public function nonexistentNoteReturnsErrorResponse(): void
{
$response = $this->call('POST', '/webmention', [
@ -76,7 +73,7 @@ class WebMentionsControllerTest extends TestCase
$response->assertStatus(400);
}
/** @test */
#[Test]
public function legitimateWebmentionTriggersProcessWebmentionJob(): void
{
Queue::fake();