Skip to content

Commit

Permalink
phpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
obenland committed Jan 9, 2025
1 parent e75db12 commit 42e7690
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions includes/rest/class-webfinger-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,16 @@ public function get_item_schema() {
'items' => array(
'type' => 'object',
'properties' => array(
'rel' => array(
'rel' => array(
'description' => 'The relation type of the link.',
'type' => 'string',
'required' => true,
),
'type' => array(
'type' => array(
'description' => 'The content type of the link.',
'type' => 'string',
),
'href' => array(
'href' => array(
'description' => 'The target URL of the link.',
'type' => 'string',
'format' => 'uri',
Expand Down
2 changes: 0 additions & 2 deletions tests/class-test-rest-controller-testcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function set_up() {
parent::set_up();
add_filter( 'rest_url', array( $this, 'filter_rest_url_for_leading_slash' ), 10, 2 );

/** @var \WP_REST_Server $wp_rest_server */
global $wp_rest_server;
$wp_rest_server = new \Spy_REST_Server();
do_action( 'rest_api_init', $wp_rest_server );
Expand All @@ -38,7 +37,6 @@ public function set_up() {
public function tear_down() {
remove_filter( 'rest_url', array( $this, 'test_rest_url_for_leading_slash' ) );

/** @var WP_REST_Server $wp_rest_server */
global $wp_rest_server;
$wp_rest_server = null;

Expand Down
8 changes: 4 additions & 4 deletions tests/includes/rest/class-test-webfinger-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function test_get_item_with_invalid_resource() {
* @covers ::get_item
*/
public function test_get_item_with_missing_resource() {
$request = new \WP_REST_Request( 'GET', '/' . ACTIVITYPUB_REST_NAMESPACE . '/webfinger' );
$request = new \WP_REST_Request( 'GET', '/' . ACTIVITYPUB_REST_NAMESPACE . '/webfinger' );
$response = rest_get_server()->dispatch( $request );

$this->assertEquals( 400, $response->get_status() );
Expand All @@ -143,8 +143,8 @@ public function test_webfinger_data_filter() {

\add_filter(
'webfinger_data',
function( $data, $resource ) use ( $test_data ) {
$this->assertEquals( 'acct:[email protected]', $resource );
function ( $data, $webfinger ) use ( $test_data ) {
$this->assertEquals( 'acct:[email protected]', $webfinger );
return $test_data;
},
10,
Expand All @@ -167,7 +167,7 @@ function( $data, $resource ) use ( $test_data ) {
*/
public function test_get_item_with_author_url() {
$author_url = \get_author_posts_url( self::$user->ID );
$request = new \WP_REST_Request( 'GET', '/' . ACTIVITYPUB_REST_NAMESPACE . '/webfinger' );
$request = new \WP_REST_Request( 'GET', '/' . ACTIVITYPUB_REST_NAMESPACE . '/webfinger' );
$request->set_param( 'resource', $author_url );

$response = rest_get_server()->dispatch( $request );
Expand Down

0 comments on commit 42e7690

Please sign in to comment.