Remove references to short domain

This commit is contained in:
Jonny Barnes 2025-04-06 17:22:36 +01:00
parent 328c9badb4
commit 7a58287b34
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
27 changed files with 215 additions and 404 deletions

View file

@ -64,7 +64,7 @@ class FeedsTest extends TestCase
'author' => [
'type' => 'card',
'name' => config('user.display_name'),
'url' => config('url.longurl'),
'url' => config('app.url'),
],
'children' => [[
'type' => 'entry',
@ -122,7 +122,7 @@ class FeedsTest extends TestCase
'author' => [
'type' => 'card',
'name' => config('user.display_name'),
'url' => config('url.longurl'),
'url' => config('app.url'),
],
'children' => [[
'type' => 'entry',

View file

@ -299,7 +299,7 @@ class MicropubControllerTest extends TestCase
'type' => ['h-entry'],
'properties' => [
'content' => [$note],
'location' => [$place->longurl],
'location' => [$place->uri],
],
],
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
@ -499,7 +499,7 @@ class MicropubControllerTest extends TestCase
'/api/post',
[
'action' => 'update',
'url' => $note->longurl,
'url' => $note->uri,
'replace' => [
'content' => ['replaced content'],
],
@ -519,7 +519,7 @@ class MicropubControllerTest extends TestCase
'/api/post',
[
'action' => 'update',
'url' => $note->longurl,
'url' => $note->uri,
'add' => [
'syndication' => [
'https://www.swarmapp.com/checkin/123',
@ -546,7 +546,7 @@ class MicropubControllerTest extends TestCase
'/api/post',
[
'action' => 'update',
'url' => $note->longurl,
'url' => $note->uri,
'add' => [
'photo' => ['https://example.org/photo.jpg'],
],
@ -607,7 +607,7 @@ class MicropubControllerTest extends TestCase
'/api/post',
[
'action' => 'update',
'url' => $note->longurl,
'url' => $note->uri,
'morph' => [ // or any other unsupported update type
'syndication' => ['https://www.swarmapp.com/checkin/123'],
],
@ -646,7 +646,7 @@ class MicropubControllerTest extends TestCase
'/api/post',
[
'action' => 'update',
'url' => $note->longurl,
'url' => $note->uri,
'replace' => [
'syndication' => [
'https://www.swarmapp.com/checkin/the-id',

View file

@ -31,7 +31,7 @@ class NotesControllerTest extends TestCase
public function specificNotePageLoads(): void
{
$note = Note::factory()->create();
$response = $this->get($note->longurl);
$response = $this->get($note->uri);
$response->assertViewHas('note');
}
@ -51,7 +51,7 @@ class NotesControllerTest extends TestCase
{
$note = Note::factory()->create();
$response = $this->get('/note/' . $note->id);
$response->assertRedirect($note->longurl);
$response->assertRedirect($note->uri);
}
/**

View file

@ -30,7 +30,7 @@ class PlacesTest extends TestCase
public function singlePlacePageLoads(): void
{
$place = Place::factory()->create();
$response = $this->get($place->longurl);
$response = $this->get($place->uri);
$response->assertViewHas('place', $place);
}

View file

@ -1,39 +0,0 @@
<?php
declare(strict_types=1);
namespace Tests\Feature;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;
class ShortURLsControllerTest extends TestCase
{
#[Test]
public function shortDomainRedirectsToLongDomain(): void
{
$response = $this->get('https://' . config('url.shorturl'));
$response->assertRedirect(config('app.url'));
}
#[Test]
public function shortDomainSlashAtRedirectsToTwitter(): void
{
$response = $this->get('https://' . config('url.shorturl') . '/@');
$response->assertRedirect('https://twitter.com/jonnybarnes');
}
#[Test]
public function shortDomainSlashTRedirectsToLongDomainSlashNotes(): void
{
$response = $this->get('https://' . config('url.shorturl') . '/t/E');
$response->assertRedirect(config('app.url') . '/notes/E');
}
#[Test]
public function shortDomainSlashBRedirectsToLongDomainSlashBlog(): void
{
$response = $this->get('https://' . config('url.shorturl') . '/b/1');
$response->assertRedirect(config('app.url') . '/blog/s/1');
}
}

View file

@ -82,7 +82,7 @@ class WebMentionsControllerTest extends TestCase
$response = $this->call('POST', '/webmention', [
'source' => 'https://example.org/post/123',
'target' => $note->longurl,
'target' => $note->uri,
]);
$response->assertStatus(202);