diff --git a/tests/Entity/LinkTest.php b/tests/Entity/LinkTest.php new file mode 100644 index 0000000000..75c380876e --- /dev/null +++ b/tests/Entity/LinkTest.php @@ -0,0 +1,36 @@ +. +// }}} + +namespace App\Tests\Entity; + +use App\Entity\Link; +use App\Util\GNUsocialTestCase; +use Jchook\AssertThrows\AssertThrows; + +class LinkTest extends GNUsocialTestCase +{ + use AssertThrows; + + public function testGetOrCreate() + { + static::assertThrows(\InvalidArgumentException::class, fn () => Link::getOrCreate('not a url')); + $link = Link::getOrCreate('https://gnu.org'); + static::assertNotNull($link->getUrl()); + } +}