Add Indieweb related link to the HTTP headers
This commit is contained in:
parent
7f70f75d05
commit
58b31bb4c1
6 changed files with 47 additions and 28 deletions
25
tests/Feature/HeaderLinkTest.php
Normal file
25
tests/Feature/HeaderLinkTest.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use Tests\TestCase;
|
||||
|
||||
class HeaderLinkTest extends TestCase
|
||||
{
|
||||
#[Test]
|
||||
public function itShouldSeeTheIndiewebRelatedLinkHeaders(): void
|
||||
{
|
||||
$response = $this->get('/');
|
||||
|
||||
$linkHeaders = $response->headers->allPreserveCaseWithoutCookies()['Link'];
|
||||
|
||||
$this->assertSame('<' . config('app.url') . '/.well-known/indieauth-server>; rel="indieauth-metadata"', $linkHeaders[0]);
|
||||
$this->assertSame('<' . config('app.url') . '/auth>; rel="authorization_endpoint"', $linkHeaders[1]);
|
||||
$this->assertSame('<' . config('app.url') . '/token>; rel="token_endpoint"', $linkHeaders[2]);
|
||||
$this->assertSame('<' . config('app.url') . '/api/post>; rel="micropub"', $linkHeaders[3]);
|
||||
$this->assertSame('<' . config('app.url') . '/webmention>; rel="webmention"', $linkHeaders[4]);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue