mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-14 10:20:34 +08:00
Add void return to method in tests. (#20602)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
namespace yiiunit\framework\caching;
|
||||
|
||||
use ReflectionClass;
|
||||
use yii\caching\FileCache;
|
||||
|
||||
/**
|
||||
@@ -30,7 +31,7 @@ class FileCacheTest extends CacheTestCase
|
||||
return $this->_cacheInstance;
|
||||
}
|
||||
|
||||
public function testExpire()
|
||||
public function testExpire(): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
@@ -42,7 +43,7 @@ class FileCacheTest extends CacheTestCase
|
||||
$this->assertFalse($cache->get('expire_test'));
|
||||
}
|
||||
|
||||
public function testExpireAdd()
|
||||
public function testExpireAdd(): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
@@ -54,7 +55,7 @@ class FileCacheTest extends CacheTestCase
|
||||
$this->assertFalse($cache->get('expire_testa'));
|
||||
}
|
||||
|
||||
public function testKeyPrefix()
|
||||
public function testKeyPrefix(): void
|
||||
{
|
||||
$keyPrefix = 'foobar';
|
||||
$key = uniqid('uid-cache_');
|
||||
@@ -68,7 +69,7 @@ class FileCacheTest extends CacheTestCase
|
||||
|
||||
$value = \time();
|
||||
|
||||
$refClass = new \ReflectionClass($cache);
|
||||
$refClass = new ReflectionClass($cache);
|
||||
|
||||
$refMethodGetCacheFile = $refClass->getMethod('getCacheFile');
|
||||
|
||||
@@ -90,13 +91,13 @@ class FileCacheTest extends CacheTestCase
|
||||
$this->assertEquals($value, $refMethodGet->invoke($cache, $key));
|
||||
}
|
||||
|
||||
public function testStatCache()
|
||||
public function testStatCache(): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
$cache->set(__FUNCTION__, 'cache1', 2);
|
||||
|
||||
$normalizeKey = $cache->buildKey(__FUNCTION__);
|
||||
$refClass = new \ReflectionClass($cache);
|
||||
$refClass = new ReflectionClass($cache);
|
||||
$refMethodGetCacheFile = $refClass->getMethod('getCacheFile');
|
||||
|
||||
// @link https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
|
||||
|
||||
Reference in New Issue
Block a user