Skip to content

Commit

Permalink
Fix missed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
riasvdv committed Jun 14, 2024
1 parent c9907ec commit 7e083d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/Stache/DuplicatesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public function it_saves_to_the_cache()

$stache = $this->mock(Stache::class);
$stache->shouldReceive('store')->with('test-store')->andReturn($store);
$stache->shouldReceive('cacheStore')->andReturn(Cache::store());

$duplicates = new Duplicates($stache);

Expand Down Expand Up @@ -145,7 +146,9 @@ public function it_loads_from_cache()
{
Cache::forever('stache::duplicates', ['foo' => 'bar']);

$duplicates = new Duplicates($this->mock(Stache::class));
$stache = $this->mock(Stache::class);
$stache->shouldReceive('cacheStore')->andReturn(Cache::store());
$duplicates = new Duplicates($stache);

$return = $duplicates->load();

Expand All @@ -158,7 +161,9 @@ public function it_clears_the_cache()
{
Cache::forever('stache::duplicates', ['foo' => 'bar']);

$duplicates = new Duplicates($this->mock(Stache::class));
$stache = $this->mock(Stache::class);
$stache->shouldReceive('cacheStore')->andReturn(Cache::store());
$duplicates = new Duplicates($stache);

$this->assertNotNull(Cache::get('stache::duplicates'));

Expand Down
2 changes: 2 additions & 0 deletions tests/Stache/Stores/AssetContainersStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Facades\Statamic\Stache\Traverser;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Cache;
use Statamic\Assets\Asset;
use Statamic\Contracts\Assets\AssetContainer;
use Statamic\Facades;
Expand Down Expand Up @@ -113,6 +114,7 @@ public function it_saves_to_disk()
Facades\Stache::shouldReceive('shouldUpdateIndexes')->andReturnTrue();
Facades\Stache::shouldReceive('duplicates')->andReturn(optional());
Facades\Stache::shouldReceive('store')->with('users')->andReturn((new UsersStore((new Stache)->sites(['en']), app('files')))->directory($this->tempDir));
Facades\Stache::shouldReceive('cacheStore')->andReturn(Cache::store());

$container = Facades\AssetContainer::make('new')
->title('New Container');
Expand Down

0 comments on commit 7e083d9

Please sign in to comment.