Skip to content

Commit

Permalink
Fixed stub calls to storage_path()
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Oct 26, 2024
1 parent ac404a9 commit 24dfec0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
},
"files": [
"tests/helpers.php"
],
"classmap": [
"tests"
]
},
"suggest": {
Expand Down
14 changes: 3 additions & 11 deletions tests/Feature/Configuration/Cache/FileCacheProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
class FileCacheProviderTest extends AbstractCacheProviderTest
{
public function getProvider()
{
{
$config = m::mock(Repository::class);
$config->shouldReceive('get')
->with('cache.stores.file.path', __DIR__ . DIRECTORY_SEPARATOR . '../../Stubs/storage/framework/cache')
->with('cache.stores.file.path', 'framework/cache')
->once()
->andReturn('/tmp');

$config->shouldReceive('get')
->with('doctrine.cache.namespace', 'doctrine-cache')
->once()
->andReturn('doctrine-cache');
->andReturn('doctrine-cache');

return new FileCacheProvider(
$config,
Expand All @@ -31,11 +31,3 @@ public function getExpectedInstance()
}
}

if(!function_exists('storage_path')) {
function storage_path($path = null)
{
$storage = __DIR__ . DIRECTORY_SEPARATOR . '../../Stubs/storage';

return is_null($path) ? $storage : $storage . DIRECTORY_SEPARATOR . $path;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
class PhpFileCacheProviderTest extends AbstractCacheProviderTest
{
public function getProvider()
{
{
$config = m::mock(Repository::class);
$config->shouldReceive('get')
->with('cache.stores.file.path', __DIR__ . DIRECTORY_SEPARATOR . '../../Stubs/storage/framework/cache')
->with('cache.stores.file.path', 'framework/cache')
->once()
->andReturn('/tmp');

$config->shouldReceive('get')
->with('doctrine.cache.namespace', 'doctrine-cache')
->once()
->andReturn('doctrine-cache');
->andReturn('doctrine-cache');

return new PhpFileCacheProvider(
$config,
Expand Down

0 comments on commit 24dfec0

Please sign in to comment.