1
0
Fork 0
Philipp Holzer 2021-08-29 13:49:10 +02:00
parent b76634ea0c
commit d517fed12d
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD

View file

@ -0,0 +1,36 @@
<?php
namespace Friendica\Test\src\Network;
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:///']),
]));
$httpClient = DI::httpClient();
$httpClient->get('https:///');
self::assertEquals(1,1);
}
}