Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions tests/Feature/WpOrg/Api/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Tests\Feature\WpOrg\Api;

use Composer\Util\HttpDownloader;
use Mockery;
use TypistTech\WpOrgClosedPlugin\WpOrg\Api\Cache;
use TypistTech\WpOrgClosedPlugin\WpOrg\Api\Client;
Expand Down Expand Up @@ -48,15 +49,7 @@
it('returns true if and only if the plugin is closed', function (string $slug, bool $expected): void {
$loop = $this->loop();
$httpDownloader = $loop->getHttpDownloader();

$cache = Mockery::mock(Cache::class);
$cache->allows()
->read()
->withAnyArgs()
->andReturnNull();
$cache->allows()
->write()
->withAnyArgs();
$cache = Mockery::spy(Cache::class);

$client = new Client($httpDownloader, $loop, $cache);

Expand All @@ -80,10 +73,7 @@

it('reads from cache', function (string $slug, bool $expected): void {
$loop = $this->loop();

$httpDownloader = Mockery::mock(
$loop->getHttpDownloader()
);
$httpDownloader = Mockery::spy(HttpDownloader::class);

$cache = Mockery::spy(Cache::class);
$cache->expects()
Expand Down
Loading