mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 18:29:39 +02:00
Update dependencies.
This commit is contained in:
parent
43c00721ca
commit
feb9ac315b
11243 changed files with 338413 additions and 11922 deletions
20
vendor/symfony/http-client/MockHttpClient.php
vendored
20
vendor/symfony/http-client/MockHttpClient.php
vendored
|
@ -17,13 +17,14 @@ use Symfony\Component\HttpClient\Response\ResponseStream;
|
|||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
use Symfony\Contracts\HttpClient\ResponseInterface;
|
||||
use Symfony\Contracts\HttpClient\ResponseStreamInterface;
|
||||
use Symfony\Contracts\Service\ResetInterface;
|
||||
|
||||
/**
|
||||
* A test-friendly HttpClient that doesn't make actual HTTP requests.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class MockHttpClient implements HttpClientInterface
|
||||
class MockHttpClient implements HttpClientInterface, ResetInterface
|
||||
{
|
||||
use HttpClientTrait;
|
||||
|
||||
|
@ -34,7 +35,16 @@ class MockHttpClient implements HttpClientInterface
|
|||
/**
|
||||
* @param callable|callable[]|ResponseInterface|ResponseInterface[]|iterable|null $responseFactory
|
||||
*/
|
||||
public function __construct($responseFactory = null, string $baseUri = null)
|
||||
public function __construct($responseFactory = null, ?string $baseUri = 'https://example.com')
|
||||
{
|
||||
$this->setResponseFactory($responseFactory);
|
||||
$this->defaultOptions['base_uri'] = $baseUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param callable|callable[]|ResponseInterface|ResponseInterface[]|iterable|null $responseFactory
|
||||
*/
|
||||
public function setResponseFactory($responseFactory): void
|
||||
{
|
||||
if ($responseFactory instanceof ResponseInterface) {
|
||||
$responseFactory = [$responseFactory];
|
||||
|
@ -47,7 +57,6 @@ class MockHttpClient implements HttpClientInterface
|
|||
}
|
||||
|
||||
$this->responseFactory = $responseFactory;
|
||||
$this->defaultOptions['base_uri'] = $baseUri;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -107,4 +116,9 @@ class MockHttpClient implements HttpClientInterface
|
|||
|
||||
return $clone;
|
||||
}
|
||||
|
||||
public function reset()
|
||||
{
|
||||
$this->requestsCount = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue