Skip to content

Commit

Permalink
Merge pull request #257 from gRegorLove/dev/fix-test
Browse files Browse the repository at this point in the history
Fix failing test
  • Loading branch information
gRegorLove committed Apr 15, 2024
2 parents e7f6b25 + 16fee61 commit e35bb9f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/Mf2/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,21 @@ public function testApplyTransformationToSrcset() {
/**
* @see https://github.com/indieweb/php-mf2/issues/84
* @group internet
*
* 2024-04-07: The final photo URL in this test changed over time.
* Updated it to only check that the final URL's hostname was correct,
* not the full photo URL.
*/
public function testRelativeURLResolvedWithFinalURL() {
$mf = Mf2\fetch('http://aaron.pk/4Zn5');

$this->assertEquals('https://aaronparecki.com/img/1240x0/2014/12/23/5/photo.jpeg', $mf['items'][0]['properties']['photo'][0]);
$this->assertArrayHasKey('photo', $mf['items'][0]['properties']);

$hostname = parse_url($mf['items'][0]['properties']['photo'][0], PHP_URL_HOST);
$this->assertEquals('aaronparecki.com', $hostname);

// previous assertion: not the photo URL changed over time
// $this->assertEquals('https://aaronparecki.com/img/1240x0/2014/12/23/5/photo.jpeg', $mf['items'][0]['properties']['photo'][0]);
}

public function testScriptTagContentsRemovedFromTextValue() {
Expand Down

0 comments on commit e35bb9f

Please sign in to comment.