diff --git a/app/Models/Article.php b/app/Models/Article.php index 9ac2335d..ab0602d1 100644 --- a/app/Models/Article.php +++ b/app/Models/Article.php @@ -93,13 +93,6 @@ class Article extends Model ); } - protected function uri(): Attribute - { - return Attribute::get( - get: fn () => config('app.url').$this->link, - ); - } - /** * Scope a query to only include articles from a particular year/month. */ diff --git a/app/Services/Micropub/Handlers/EntryHandler.php b/app/Services/Micropub/Handlers/EntryHandler.php index d79a0418..48bbb550 100644 --- a/app/Services/Micropub/Handlers/EntryHandler.php +++ b/app/Services/Micropub/Handlers/EntryHandler.php @@ -37,7 +37,7 @@ class EntryHandler implements MicropubHandlerInterface $location = match (true) { isset($dataArray['like-of']) => resolve(LikeService::class)->create($dataArray)->url, isset($dataArray['bookmark-of']) => resolve(BookmarkService::class)->create($dataArray)->uri, - isset($dataArray['name']) => resolve(ArticleService::class)->create($dataArray)->uri, + isset($dataArray['name']) => resolve(ArticleService::class)->create($dataArray)->link, default => resolve(NoteService::class)->create($dataArray)->uri, }; diff --git a/tests/Feature/MicropubControllerTest.php b/tests/Feature/MicropubControllerTest.php index e1795561..efcfb6ce 100644 --- a/tests/Feature/MicropubControllerTest.php +++ b/tests/Feature/MicropubControllerTest.php @@ -871,8 +871,6 @@ class MicropubControllerTest extends TestCase 'main' => $content, 'published' => true, ]); - $response->assertHeader('Location'); - $this->assertStringStartsWith(config('app.url').'/blog/', $response->headers->get('Location')); } #[Test] diff --git a/tests/Unit/ArticlesTest.php b/tests/Unit/ArticlesTest.php index 0de3277d..fda1abf4 100644 --- a/tests/Unit/ArticlesTest.php +++ b/tests/Unit/ArticlesTest.php @@ -63,17 +63,6 @@ class ArticlesTest extends TestCase ); } - #[Test] - public function uri_is_the_absolute_form_of_the_link(): void - { - $article = Article::create([ - 'title' => 'Test', - 'main' => 'Test', - ]); - - $this->assertEquals(config('app.url').$article->link, $article->uri); - } - #[Test] public function date_scope_returns_expected_articles(): void {