From 4d4ab89ec090e220c7c15c579a51c60a6d1eed89 Mon Sep 17 00:00:00 2001 From: Barnaby Walters Date: Sat, 5 Nov 2022 22:40:31 +0100 Subject: [PATCH] Updated test to make sure that the h-card URL property exists even on h-cards with no URL --- tests/LibraryTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/LibraryTest.php b/tests/LibraryTest.php index 2100807..3218bbd 100644 --- a/tests/LibraryTest.php +++ b/tests/LibraryTest.php @@ -78,6 +78,8 @@ class LibraryTest extends PHPUnit\Framework\TestCase $xray = new p3k\XRay(); $data = $xray->parse($url, $html); $this->assertEquals('card', $data['data']['type']); + // On pages where the h-card is the main data but lacks a URL property, it will be filled with the page URL. + $this->assertEquals($url, $data['data']['url']); } public function testDefaultOptionsAreUsed()