Skip to content

Commit

Permalink
Merge pull request #841 from jtojnar/fix-ci
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
mblaney committed Aug 8, 2023
2 parents 4469ac9 + 24ff643 commit bb01ef4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tests/LocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,17 @@ public function test_from_file(File $data): void
$document->loadHTML($data->body);
$xpath = new DOMXPath($document);
foreach ($xpath->query('//link') as $element) {
/** @var \DOMElement $element */
$expected[] = 'http://example.com' . $element->getAttribute('href');
}
//$expected = SimplePie_Misc::get_element('link', $data->body);

$feed = $locator->find(SIMPLEPIE_LOCATOR_ALL, $all);
$this->assertFalse($locator->is_feed($data), 'HTML document not be a feed itself');
$this->assertInstanceOf(FileMock::class, $feed);
$success = array_filter($expected, [get_class(), 'filter_success']);
$success = array_filter($expected, [get_class($this), 'filter_success']);

$found = array_map([get_class(), 'map_url_file'], $all);
$found = array_map([get_class($this), 'map_url_file'], $all);
$this->assertSame($success, $found);
}

Expand Down
5 changes: 3 additions & 2 deletions tests/Unit/LocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,17 @@ public function test_from_file(File $data): void
$document->loadHTML($data->body);
$xpath = new DOMXPath($document);
foreach ($xpath->query('//link') as $element) {
/** @var \DOMElement $element */
$expected[] = 'http://example.com' . $element->getAttribute('href');
}
//$expected = SimplePie_Misc::get_element('link', $data->body);

$feed = $locator->find(SimplePie::LOCATOR_ALL, $all);
$this->assertFalse($locator->is_feed($data), 'HTML document not be a feed itself');
$this->assertInstanceOf(FileMock::class, $feed);
$success = array_filter($expected, [get_class(), 'filter_success']);
$success = array_filter($expected, [get_class($this), 'filter_success']);

$found = array_map([get_class(), 'map_url_file'], $all);
$found = array_map([get_class($this), 'map_url_file'], $all);
$this->assertSame($success, $found);
}

Expand Down

0 comments on commit bb01ef4

Please sign in to comment.