From 28222008dd8a82e592b08754417e762de4dab087 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Thu, 28 Feb 2019 19:32:03 +0100 Subject: [PATCH] new tests --- tests/test-class-activitypub.php | 10 ++++++++++ tests/test-class-db-activitypub-followers.php | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/test-class-activitypub.php diff --git a/tests/test-class-activitypub.php b/tests/test-class-activitypub.php new file mode 100644 index 0000000..090389b --- /dev/null +++ b/tests/test-class-activitypub.php @@ -0,0 +1,10 @@ +assertContains( 'post', get_post_types_by_support( 'activitypub' ) ); + $this->assertContains( 'page', get_post_types_by_support( 'activitypub' ) ); + } +} diff --git a/tests/test-class-db-activitypub-followers.php b/tests/test-class-db-activitypub-followers.php index eaeecbd..77e01e4 100644 --- a/tests/test-class-db-activitypub-followers.php +++ b/tests/test-class-db-activitypub-followers.php @@ -15,4 +15,13 @@ class Test_Db_Activitypub_Followers extends WP_UnitTestCase { $this->assertSame( array( 'https://example.com/author/jon', 'https://example.org/author/doe', 'http://sally.example.org' ), $db_followers ); } + + public function test_add_follower() { + $follower = 'https://example.com/author/' . time(); + \Activitypub\Db\Followers::add_follower( $follower, 1 ); + + $db_followers = \Activitypub\Db\Followers::get_followers( 1 ); + + $this->assertContains( $follower, $db_followers ); + } }