Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/php/Admin/Bluesky_ProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1526,13 +1526,13 @@ public function test_handle_connect_strips_leading_at() {
// phpcs:enable WordPress.Security.NonceVerification.Missing

// Intercept the HTTP request that Client::authorize() makes to
// the handle's auth server, and capture the handle it resolved.
// the handle's auth server, and capture the normalized handle it resolved.
$captured_handle = null;
add_filter(
'pre_http_request',
static function ( $preempt, $args, $url ) use ( &$captured_handle ) {
// The first HTTP call from authorize() is handle resolution.
// Capture the URL to verify no leading @ was passed.
// Capture the URL to verify the normalized handle was passed.
$captured_handle = $url;
// Return an error to short-circuit the flow.
return new \WP_Error( 'fosse_test_intercept', 'intercepted' );
Expand All @@ -1559,7 +1559,9 @@ static function () {
$captured_handle,
'Expected pre_http_request to fire from Client::authorize() — handle normalization could not be verified.'
);
$this->assertStringContainsString( 'alice.bsky.social', $captured_handle );
$this->assertStringNotContainsString( '@alice', $captured_handle );
$this->assertStringNotContainsString( '%40alice', $captured_handle );
}

/**
Expand Down
Loading