-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into change/improve-conneg-extensibility
- Loading branch information
Showing
8 changed files
with
293 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,11 +17,11 @@ | |
class Test_Activity_Dispatcher extends ActivityPub_TestCase_Cache_HTTP { | ||
|
||
/** | ||
* Users. | ||
* Actors. | ||
* | ||
* @var array[] $users | ||
* @var array[] | ||
*/ | ||
public static $users = array( | ||
public static $actors = array( | ||
'[email protected]' => array( | ||
'id' => 'https://example.org/users/username', | ||
'url' => 'https://example.org/users/username', | ||
|
@@ -109,7 +109,7 @@ public function test_dispatch_mentions() { | |
) | ||
); | ||
|
||
self::$users['https://example.com/alex'] = array( | ||
self::$actors['https://example.com/alex'] = array( | ||
'id' => 'https://example.com/alex', | ||
'url' => 'https://example.com/alex', | ||
'inbox' => 'https://example.com/alex/inbox', | ||
|
@@ -300,10 +300,10 @@ function ( $disabled, $user_id ) { | |
* @return array|bool | ||
*/ | ||
public static function pre_get_remote_metadata_by_actor( $pre, $actor ) { | ||
if ( isset( self::$users[ $actor ] ) ) { | ||
return self::$users[ $actor ]; | ||
if ( isset( self::$actors[ $actor ] ) ) { | ||
return self::$actors[ $actor ]; | ||
} | ||
foreach ( self::$users as $data ) { | ||
foreach ( self::$actors as $data ) { | ||
if ( $data['url'] === $actor ) { | ||
return $data; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,11 +17,11 @@ | |
class Test_Mention extends \WP_UnitTestCase { | ||
|
||
/** | ||
* Users. | ||
* Actors. | ||
* | ||
* @var array | ||
* @var array[] | ||
*/ | ||
public static $users = array( | ||
public static $actors = array( | ||
'[email protected]' => array( | ||
'id' => 'https://example.org/users/username', | ||
'url' => 'https://example.org/users/username', | ||
|
@@ -133,8 +133,8 @@ public function pre_http_request( $response, $parsed_args, $url ) { | |
public static function pre_get_remote_metadata_by_actor( $pre, $actor ) { | ||
$actor = ltrim( $actor, '@' ); | ||
|
||
if ( isset( self::$users[ $actor ] ) ) { | ||
return self::$users[ $actor ]; | ||
if ( isset( self::$actors[ $actor ] ) ) { | ||
return self::$actors[ $actor ]; | ||
} | ||
|
||
return $pre; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,11 +17,11 @@ | |
class Test_Followers extends \WP_UnitTestCase { | ||
|
||
/** | ||
* Users. | ||
* Actors. | ||
* | ||
* @var array[] | ||
*/ | ||
public static $users = array( | ||
public static $actors = array( | ||
'[email protected]' => array( | ||
'id' => 'https://example.org/users/username', | ||
'url' => 'https://example.org/users/username', | ||
|
@@ -399,8 +399,8 @@ public function test_migration_followers( $followers, $expected_count ) { | |
add_filter( | ||
'pre_get_remote_metadata_by_actor', | ||
function ( $pre, $actor ) { | ||
if ( isset( self::$users[ $actor ] ) ) { | ||
return self::$users[ $actor ]; | ||
if ( isset( self::$actors[ $actor ] ) ) { | ||
return self::$actors[ $actor ]; | ||
} | ||
return $pre; | ||
}, | ||
|
@@ -549,10 +549,10 @@ public function test_get_all_followers() { | |
* @return array | ||
*/ | ||
public static function pre_get_remote_metadata_by_actor( $pre, $actor ) { | ||
if ( isset( self::$users[ $actor ] ) ) { | ||
return self::$users[ $actor ]; | ||
if ( isset( self::$actors[ $actor ] ) ) { | ||
return self::$actors[ $actor ]; | ||
} | ||
foreach ( self::$users as $data ) { | ||
foreach ( self::$actors as $data ) { | ||
if ( $data['url'] === $actor ) { | ||
return $data; | ||
} | ||
|
Oops, something went wrong.