mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-15 10:50:45 +08:00
Add void return to method in tests. (#20602)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
namespace yiiunit\framework\caching;
|
||||
|
||||
use yii\db\Connection;
|
||||
use yii\caching\DbCache;
|
||||
|
||||
/**
|
||||
@@ -41,14 +42,14 @@ class DbCacheTest extends CacheTestCase
|
||||
|
||||
/**
|
||||
* @param bool $reset whether to clean up the test database
|
||||
* @return \yii\db\Connection
|
||||
* @return Connection
|
||||
*/
|
||||
public function getConnection($reset = true)
|
||||
{
|
||||
if ($this->_connection === null) {
|
||||
$databases = self::getParam('databases');
|
||||
$params = $databases['mysql'];
|
||||
$db = new \yii\db\Connection();
|
||||
$db = new Connection();
|
||||
$db->dsn = $params['dsn'];
|
||||
$db->username = $params['username'];
|
||||
$db->password = $params['password'];
|
||||
@@ -79,7 +80,7 @@ class DbCacheTest extends CacheTestCase
|
||||
return $this->_cacheInstance;
|
||||
}
|
||||
|
||||
public function testExpire()
|
||||
public function testExpire(): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
@@ -91,7 +92,7 @@ class DbCacheTest extends CacheTestCase
|
||||
$this->assertFalse($cache->get('expire_test'));
|
||||
}
|
||||
|
||||
public function testExpireAdd()
|
||||
public function testExpireAdd(): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
@@ -103,7 +104,7 @@ class DbCacheTest extends CacheTestCase
|
||||
$this->assertFalse($cache->get('expire_testa'));
|
||||
}
|
||||
|
||||
public function testSynchronousSetWithTheSameKey()
|
||||
public function testSynchronousSetWithTheSameKey(): void
|
||||
{
|
||||
$KEY = 'sync-test-key';
|
||||
$VALUE = 'sync-test-value';
|
||||
|
||||
Reference in New Issue
Block a user