Fix test for static private method
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 47s
PHPUnit / PHPUnit – PHP 7.4 (pull_request) Failing after 56s
PHPUnit / PHPUnit – PHP 8.0 (pull_request) Failing after 56s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 54s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 55s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 53s
PHPUnit / PHPUnit – PHP 8.4 (pull_request) Failing after 56s

This commit is contained in:
André Menrath 2025-01-04 12:32:32 +01:00
parent c291c81ecc
commit 60ebd72e41

View file

@ -135,7 +135,14 @@ class Test_Outbox_Parser extends \WP_UnitTestCase {
'object' => 'https://remote2.example/@actor/status/2',
),
);
$count = \Event_Bridge_For_ActivityPub\Outbox_Parser::import_events_from_items( $items, 'https://remote.example/@organizer' );
// The function we want to test is private, so we need a Reflection class.
$reflection = new \ReflectionClass( \Event_Bridge_For_ActivityPub\Outbox_Parser::class );
$method = $reflection->getMethod( 'import_events_from_items' );
$method->setAccessible( true );
$count = $method->invoke( null, $items, 'https://remote.example/@organizer' );
$this->assertEquals( 2, $count );