Skip to content

Commit c257970

Browse files
committed
Update CollectionTest.php
1 parent 2c22d6c commit c257970

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tests/CollectionTest.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use PHPUnit\Framework\TestCase;
99
use Psr\Http\Client\ClientInterface;
1010
use Psr\Http\Message\RequestFactoryInterface;
11+
use Yiisoft\Factory\Factory as YiisoftFactory;
1112
use Yiisoft\Yii\AuthClient\Collection;
1213
use Yiisoft\Yii\AuthClient\StateStorage\SessionStateStorage;
1314
use 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

Comments
 (0)