From bbf40a5fec7968d79f67a6b3bae48819e5d55581 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 19 Jun 2023 11:10:15 +0200 Subject: [PATCH] added more tests --- tests/test-class-db-activitypub-followers.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test-class-db-activitypub-followers.php b/tests/test-class-db-activitypub-followers.php index a803c03..482cecc 100644 --- a/tests/test-class-db-activitypub-followers.php +++ b/tests/test-class-db-activitypub-followers.php @@ -123,7 +123,10 @@ class Test_Db_Activitypub_Followers extends WP_UnitTestCase { } public function test_delete_follower() { - $followers = array( 'https://example.com/author/jon' ); + $followers = array( + 'https://example.com/author/jon', + 'https://example.org/author/doe', + ); $followers2 = array( 'https://user2.example.com' ); $pre_http_request = new MockAction(); @@ -143,6 +146,9 @@ class Test_Db_Activitypub_Followers extends WP_UnitTestCase { $follower = \Activitypub\Collection\Followers::get_follower( 1, 'https://example.com/author/jon' ); $this->assertEquals( 'https://example.com/author/jon', $follower->get_actor() ); + $followers = \Activitypub\Collection\Followers::get_followers( 1 ); + $this->assertEquals( 2, count( $followers ) ); + $follower2 = \Activitypub\Collection\Followers::get_follower( 2, 'https://example.com/author/jon' ); $this->assertEquals( 'https://example.com/author/jon', $follower2->get_actor() ); @@ -153,6 +159,9 @@ class Test_Db_Activitypub_Followers extends WP_UnitTestCase { $follower2 = \Activitypub\Collection\Followers::get_follower( 2, 'https://example.com/author/jon' ); $this->assertEquals( 'https://example.com/author/jon', $follower2->get_actor() ); + + $followers = \Activitypub\Collection\Followers::get_followers( 1 ); + $this->assertEquals( 1, count( $followers ) ); } public function test_get_outdated_followers() {