Skip to content

Commit 7572b6f

Browse files
authored
Add comprehensive unit tests for Server class (#2227)
1 parent 764d53f commit 7572b6f

File tree

3 files changed

+407
-8
lines changed

3 files changed

+407
-8
lines changed

includes/rest/class-server.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ class Server {
2323
* Initialize the class, registering WordPress hooks.
2424
*/
2525
public static function init() {
26-
self::add_hooks();
27-
}
28-
29-
/**
30-
* Add sever hooks.
31-
*/
32-
public static function add_hooks() {
3326
\add_filter( 'rest_request_before_callbacks', array( self::class, 'validate_requests' ), 9, 3 );
3427
\add_filter( 'rest_request_parameter_order', array( self::class, 'request_parameter_order' ), 10, 2 );
3528

tests/includes/rest/class-test-actors-inbox-controller.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Activitypub\Tests\Rest;
99

1010
use Activitypub\Collection\Actors;
11+
use Activitypub\Rest\Server;
1112

1213
/**
1314
* Test class for Actors_Inbox_Controller.
@@ -51,7 +52,7 @@ public static function set_up_before_class() {
5152
public function set_up() {
5253
\add_option( 'permalink_structure', '/%postname%/' );
5354

54-
\Activitypub\Rest\Server::add_hooks();
55+
Server::init();
5556
}
5657

5758
/**

0 commit comments

Comments
 (0)