88use PHPUnit \Framework \TestCase ;
99use Psr \Http \Client \ClientInterface ;
1010use Psr \Http \Message \RequestFactoryInterface ;
11+ use Yiisoft \Factory \Factory as YiisoftFactory ;
1112use Yiisoft \Yii \AuthClient \Collection ;
1213use Yiisoft \Yii \AuthClient \StateStorage \SessionStateStorage ;
1314use Yiisoft \Yii \AuthClient \StateStorage \StateStorageInterface ;
@@ -21,6 +22,11 @@ private function getRequestFactory(): RequestFactoryInterface
2122 return new Psr17Factory ();
2223 }
2324
25+ private function getYiisoftFactory (): YiisoftFactory
26+ {
27+ return new YiisoftFactory ();
28+ }
29+
2430 private function getStateStorage (): StateStorageInterface
2531 {
2632 return new SessionStateStorage (new Session ());
@@ -29,7 +35,13 @@ private function getStateStorage(): StateStorageInterface
2935 private function getTestClient (): TestClient
3036 {
3137 $ httpClient = $ this ->getMockBuilder (ClientInterface::class)->getMock ();
32- return new TestClient ($ httpClient , $ this ->getRequestFactory (), $ this ->getStateStorage ());
38+ return new TestClient (
39+ $ httpClient ,
40+ $ this ->getRequestFactory (),
41+ $ this ->getStateStorage (),
42+ $ this ->getYiisoftFactory (),
43+ new Session (),
44+ );
3345 }
3446
3547 public function testSetGet (): void
@@ -68,4 +80,4 @@ public function testHasProvider(): void
6880 $ this ->assertTrue ($ collection ->hasClient ($ clientName ), 'Existing client check fails! ' );
6981 $ this ->assertFalse ($ collection ->hasClient ('nonExistingClientName ' ), 'Not existing client check fails! ' );
7082 }
71- }
83+ }
0 commit comments