mirror of
https://github.com/friendica/friendica
synced 2024-11-12 22:22:54 +00:00
Add test case for https://github.com/friendica/friendica/issues/11726
This commit is contained in:
parent
d9d30c7b06
commit
83a16ac114
1 changed files with 15 additions and 0 deletions
|
@ -49,4 +49,19 @@ class HTTPClientTest extends MockedTest
|
||||||
|
|
||||||
self::assertFalse(DI::httpClient()->get('https://friendica.local')->isSuccess());
|
self::assertFalse(DI::httpClient()->get('https://friendica.local')->isSuccess());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test for issue https://github.com/friendica/friendica/issues/11726
|
||||||
|
*/
|
||||||
|
public function testRedirect()
|
||||||
|
{
|
||||||
|
$this->httpRequestHandler->setHandler(new MockHandler([
|
||||||
|
new Response(302, ['Location' => 'https://mastodon.social/about']),
|
||||||
|
new Response(200, ['Location' => 'https://mastodon.social']),
|
||||||
|
]));
|
||||||
|
|
||||||
|
$result = DI::httpClient()->get('https://mastodon.social');
|
||||||
|
self::assertEquals('https://mastodon.social', $result->getUrl());
|
||||||
|
self::assertEquals('https://mastodon.social/about', $result->getRedirectUrl());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue