Browse Source

Updated test to make sure that the h-card URL property exists even on h-cards with no URL

pull/111/head
Barnaby Walters 2 years ago
parent
commit
4d4ab89ec0
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      tests/LibraryTest.php

+ 2
- 0
tests/LibraryTest.php View File

@ -78,6 +78,8 @@ class LibraryTest extends PHPUnit\Framework\TestCase
$xray = new p3k\XRay(); $xray = new p3k\XRay();
$data = $xray->parse($url, $html); $data = $xray->parse($url, $html);
$this->assertEquals('card', $data['data']['type']); $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() public function testDefaultOptionsAreUsed()

Loading…
Cancel
Save