Skip to content

Commit

Permalink
fix cache set return type in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wickedOne committed Oct 7, 2023
1 parent 59469ed commit 8733352
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/PhraseProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ public function testReadFallbackLocale(): void
*/
public function testCacheKeyOptionsSort(array $options, string $expectedKey): void
{
$this->getCache()->expects(self::once())->method('getItem')->with($expectedKey);
$item = $this->createMock(CacheItemInterface::class);
$item->method('set')->willReturnSelf();

$this->getCache()->expects(self::once())->method('getItem')->with($expectedKey)->willReturn($item);
$this->getReadConfig()->method('getOptions')->willReturn($options);

$this->getReadConfig()->expects(self::once())
Expand Down Expand Up @@ -519,6 +522,10 @@ public function testInitLocalesExceptions(int $statusCode, string $expectedExcep

public function testInitLocalesPaginated(): void
{
$item = $this->createMock(CacheItemInterface::class);
$item->method('set')->willReturnSelf();
$this->getCache()->method('getItem')->willReturn($item);

$this->readConfigWithDefaultValues('messages');

$this->getLoader()->method('load')->willReturn(new MessageCatalogue('en'));
Expand Down Expand Up @@ -576,6 +583,10 @@ public function testInitLocalesPaginated(): void

public function testCreateUnknownLocale(): void
{
$item = $this->createMock(CacheItemInterface::class);
$item->method('set')->willReturnSelf();
$this->getCache()->method('getItem')->willReturn($item);

$this->readConfigWithDefaultValues('messages');

$this->getLoader()->method('load')->willReturn(new MessageCatalogue('en'));
Expand Down

0 comments on commit 8733352

Please sign in to comment.