mirror of
https://github.com/friendica/friendica
synced 2025-04-22 09:50:12 +00:00
Restructure HTTPClient for new paradigm
This commit is contained in:
parent
fa55928ea3
commit
409d909d0f
25 changed files with 210 additions and 198 deletions
33
tests/src/Network/HTTPClient/Client/HTTPClientTest.php
Normal file
33
tests/src/Network/HTTPClient/Client/HTTPClientTest.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Test\src\Network\HTTPClient\Client;
|
||||
|
||||
use Friendica\DI;
|
||||
use Friendica\Test\DiceHttpMockHandlerTrait;
|
||||
use Friendica\Test\MockedTest;
|
||||
use GuzzleHttp\Handler\MockHandler;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
|
||||
class HTTPClientTest extends MockedTest
|
||||
{
|
||||
use DiceHttpMockHandlerTrait;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->setupHttpMockHandler();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for issue https://github.com/friendica/friendica/issues/10473#issuecomment-907749093
|
||||
*/
|
||||
public function testInvalidURI()
|
||||
{
|
||||
$this->httpRequestHandler->setHandler(new MockHandler([
|
||||
new Response(301, ['Location' => 'https:///']),
|
||||
]));
|
||||
|
||||
self::assertFalse(DI::httpClient()->get('https://friendica.local')->isSuccess());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue