Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit b91f2bd

Browse files
committed
🚿 use chosen PSR-17 factories also for the test subject
1 parent edf9991 commit b91f2bd

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
<const name="REQUEST_FACTORY" value="GuzzleHttp\Psr7\HttpFactory"/>
3030
<const name="RESPONSE_FACTORY" value="GuzzleHttp\Psr7\HttpFactory"/>
3131
<const name="STREAM_FACTORY" value="GuzzleHttp\Psr7\HttpFactory"/>
32+
<const name="URI_FACTORY" value="GuzzleHttp\Psr7\HttpFactory"/>
3233
</php>
3334
</phpunit>

tests/Providers/ProviderTestAbstract.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace chillerlan\OAuthTest\Providers;
1212

1313
use chillerlan\DotEnv\DotEnv;
14-
use Psr\Http\Message\{RequestFactoryInterface, ResponseFactoryInterface, StreamFactoryInterface};
14+
use Psr\Http\Message\{RequestFactoryInterface, ResponseFactoryInterface, StreamFactoryInterface, UriFactoryInterface};
1515
use chillerlan\OAuth\Core\OAuthInterface;
1616
use chillerlan\OAuth\OAuthOptions;
1717
use chillerlan\OAuth\Storage\MemoryStorage;
@@ -35,6 +35,7 @@ abstract class ProviderTestAbstract extends TestCase{
3535
'requestFactory' => 'REQUEST_FACTORY',
3636
'responseFactory' => 'RESPONSE_FACTORY',
3737
'streamFactory' => 'STREAM_FACTORY',
38+
'uriFactory' => 'URI_FACTORY',
3839
];
3940

4041
/** @var \chillerlan\OAuth\OAuthOptions|\chillerlan\Settings\SettingsContainerInterface */
@@ -47,6 +48,7 @@ abstract class ProviderTestAbstract extends TestCase{
4748
protected RequestFactoryInterface $requestFactory;
4849
protected ResponseFactoryInterface $responseFactory;
4950
protected StreamFactoryInterface $streamFactory;
51+
protected UriFactoryInterface $uriFactory;
5052
protected ClientInterface $http;
5153
protected LoggerInterface $logger;
5254

@@ -88,6 +90,12 @@ protected function setUp():void{
8890
$this->reflection = new ReflectionClass($this->FQN);
8991
/** @noinspection PhpFieldAssignmentTypeMismatchInspection */
9092
$this->provider = $this->reflection->newInstanceArgs([$this->http, $this->storage, $this->options, $this->logger]);
93+
94+
$this->provider
95+
->setRequestFactory($this->requestFactory)
96+
->setStreamFactory($this->streamFactory)
97+
->setUriFactory($this->uriFactory)
98+
;
9199
}
92100

93101
protected function initOptions():SettingsContainerInterface{

0 commit comments

Comments
 (0)