Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests(cache): add tests for Leevel\Cache\Load::clearCacheLoaded
- Loading branch information
1 parent
dfb82ea
commit 71a090c
Showing
2 changed files
with
107 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the ************************ package. | ||
* _____________ _______________ | ||
* ______/ \__ _____ ____ ______ / /_ _________ | ||
* ____/ __ / / / / _ \/ __`\/ / __ \/ __ \/ __ \___ | ||
* __/ / / / /_/ / __/ / \ / /_/ / / / / /_/ /__ | ||
* \_\ \_/\____/\___/_/ / / .___/_/ /_/ .___/ | ||
* \_\ /_/_/ /_/ | ||
* | ||
* The PHP Framework For Code Poem As Free As Wind. <Query Yet Simple> | ||
* (c) 2010-2020 http://queryphp.com All rights reserved. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Tests\Cache\Pieces; | ||
|
||
use Leevel\Cache\File; | ||
use Leevel\Cache\IBlock; | ||
use Leevel\Cache\ICache; | ||
|
||
class Test5 implements IBlock | ||
{ | ||
public function handle(array $params = []): array | ||
{ | ||
return ['data' => $GLOBALS['cache_data'] ?? 'test5']; | ||
} | ||
|
||
public function cache(): ICache | ||
{ | ||
return new File([ | ||
'path' => __DIR__.'/cacheLoad', | ||
]); | ||
} | ||
|
||
public static function key(array $params = []): string | ||
{ | ||
return 'test5'; | ||
} | ||
} |