Skip to content

Commit

Permalink
ci: Fix tests on PHP 8.3
Browse files Browse the repository at this point in the history
As mentioned in `get_class` PHP manual entry:

> Explicitly passing `null` as the `object` is no longer allowed as of PHP 7.2.0 and emits an `E_WARNING`. As of PHP 8.0.0, a `TypeError` is emitted when `null` is used.

https://www.php.net/manual/en/function.get-class.php
  • Loading branch information
jtojnar committed Aug 6, 2023
1 parent cdad5e0 commit 24ff643
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/LocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ public function test_from_file(File $data): void
$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
4 changes: 2 additions & 2 deletions tests/Unit/LocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ public function test_from_file(File $data): void
$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 24ff643

Please sign in to comment.