Skip to content

Commit e35bb9f

Browse files
authored
Merge pull request #257 from gRegorLove/dev/fix-test
Fix failing test
2 parents e7f6b25 + 16fee61 commit e35bb9f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/Mf2/ParserTest.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,21 @@ public function testApplyTransformationToSrcset() {
382382
/**
383383
* @see https://github.com/indieweb/php-mf2/issues/84
384384
* @group internet
385+
*
386+
* 2024-04-07: The final photo URL in this test changed over time.
387+
* Updated it to only check that the final URL's hostname was correct,
388+
* not the full photo URL.
385389
*/
386390
public function testRelativeURLResolvedWithFinalURL() {
387391
$mf = Mf2\fetch('http://aaron.pk/4Zn5');
388392

389-
$this->assertEquals('https://aaronparecki.com/img/1240x0/2014/12/23/5/photo.jpeg', $mf['items'][0]['properties']['photo'][0]);
393+
$this->assertArrayHasKey('photo', $mf['items'][0]['properties']);
394+
395+
$hostname = parse_url($mf['items'][0]['properties']['photo'][0], PHP_URL_HOST);
396+
$this->assertEquals('aaronparecki.com', $hostname);
397+
398+
// previous assertion: not the photo URL changed over time
399+
// $this->assertEquals('https://aaronparecki.com/img/1240x0/2014/12/23/5/photo.jpeg', $mf['items'][0]['properties']['photo'][0]);
390400
}
391401

392402
public function testScriptTagContentsRemovedFromTextValue() {

0 commit comments

Comments
 (0)