From 3bef8a349fe2a48873498758e3012bb24aeedc97 Mon Sep 17 00:00:00 2001 From: Ross Bearman Date: Fri, 19 Sep 2025 00:56:38 +0100 Subject: [PATCH] Make test URLs environment-agnostic Alter link generation tests to use `config('app.url')`, rather than hardcoding `https://pixelfed.dev` --- tests/Unit/Lexer/StatusLexerTest.php | 2 +- tests/Unit/Lexer/UsernameTest.php | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/Unit/Lexer/StatusLexerTest.php b/tests/Unit/Lexer/StatusLexerTest.php index 6e227332e..62f329692 100644 --- a/tests/Unit/Lexer/StatusLexerTest.php +++ b/tests/Unit/Lexer/StatusLexerTest.php @@ -61,7 +61,7 @@ class StatusLexerTest extends TestCase #[Test] public function autolink() { - $expected = '@pixelfed hi, really like the website! #píxelfed'; + $expected = '@pixelfed hi, really like the website! #píxelfed'; $this->assertEquals($this->autolink, $expected); } diff --git a/tests/Unit/Lexer/UsernameTest.php b/tests/Unit/Lexer/UsernameTest.php index bbcab36b9..c8f48576f 100644 --- a/tests/Unit/Lexer/UsernameTest.php +++ b/tests/Unit/Lexer/UsernameTest.php @@ -15,7 +15,7 @@ class UsernameTest extends TestCase $username = '@dansup'; $entities = Extractor::create()->extract($username); $autolink = Autolink::create()->autolink($username); - $expectedAutolink = '@dansup'; + $expectedAutolink = '@dansup'; $expectedEntity = [ 'hashtags' => [], 'urls' => [], @@ -45,7 +45,7 @@ class UsernameTest extends TestCase $username = '@dansup.two'; $autolink = Autolink::create()->autolink($username); $entities = Extractor::create()->extract($username); - $expectedAutolink = '@dansup.two'; + $expectedAutolink = '@dansup.two'; $expectedEntity = [ 'hashtags' => [], 'urls' => [], @@ -75,7 +75,7 @@ class UsernameTest extends TestCase $username = '@dansup-too'; $autolink = Autolink::create()->autolink($username); $entities = Extractor::create()->extract($username); - $expectedAutolink = '@dansup-too'; + $expectedAutolink = '@dansup-too'; $expectedEntity = [ 'hashtags' => [], 'urls' => [], @@ -105,7 +105,7 @@ class UsernameTest extends TestCase $username = '@dansup_too'; $autolink = Autolink::create()->autolink($username); $entities = Extractor::create()->extract($username); - $expectedAutolink = '@dansup_too'; + $expectedAutolink = '@dansup_too'; $expectedEntity = [ 'hashtags' => [], 'urls' => [], @@ -135,7 +135,7 @@ class UsernameTest extends TestCase $text = 'hello @dansup and @pixelfed.team from @username_underscore'; $autolink = Autolink::create()->autolink($text); $entities = Extractor::create()->extract($text); - $expectedAutolink = 'hello @dansup and @pixelfed.team from @username_underscore'; + $expectedAutolink = 'hello @dansup and @pixelfed.team from @username_underscore'; $expectedEntity = [ 'hashtags' => [], 'urls' => [], @@ -182,7 +182,7 @@ class UsernameTest extends TestCase $mentions = "@März and @königin and @Glück"; $autolink = Autolink::create()->autolink($mentions); - $expectedAutolink = '@März and @königin and @Glück'; + $expectedAutolink = '@März and @königin and @Glück'; $this->assertEquals($expectedAutolink, $autolink); } @@ -236,7 +236,7 @@ class UsernameTest extends TestCase $mentions = "hello @märz@example.org!"; $autolink = Autolink::create()->autolink($mentions); - $expectedAutolink = 'hello @märz@example.org!'; + $expectedAutolink = 'hello @märz@example.org!'; $this->assertEquals($expectedAutolink, $autolink); } }