new tests

This commit is contained in:
Matthias Pfefferle 2019-02-28 19:32:03 +01:00
parent e2d708d23c
commit 28222008dd
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,10 @@
<?php
class Test_Activitypub extends WP_UnitTestCase {
public function test_post_type_support() {
add_post_type_support( 'post', 'activitypub' );
add_post_type_support( 'page', 'activitypub' );
$this->assertContains( 'post', get_post_types_by_support( 'activitypub' ) );
$this->assertContains( 'page', get_post_types_by_support( 'activitypub' ) );
}
}

View file

@ -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 );
}
}