mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-16 03:28:56 +08:00
Add void return to method in tests. (#20602)
This commit is contained in:
@@ -82,7 +82,7 @@ abstract class CacheTestCase extends TestCase
|
||||
return $cache;
|
||||
}
|
||||
|
||||
public function testSet()
|
||||
public function testSet(): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
@@ -91,7 +91,7 @@ abstract class CacheTestCase extends TestCase
|
||||
$this->assertTrue($cache->set('array_test', ['array_test' => 'array_test']));
|
||||
}
|
||||
|
||||
public function testGet()
|
||||
public function testGet(): void
|
||||
{
|
||||
$cache = $this->prepare();
|
||||
|
||||
@@ -116,7 +116,7 @@ abstract class CacheTestCase extends TestCase
|
||||
* @dataProvider multiSetExpiry
|
||||
* @param int $expiry
|
||||
*/
|
||||
public function testMultiset($expiry)
|
||||
public function testMultiset($expiry): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
$cache->flush();
|
||||
@@ -136,7 +136,7 @@ abstract class CacheTestCase extends TestCase
|
||||
$this->assertEquals('array_test', $array['array_test']);
|
||||
}
|
||||
|
||||
public function testExists()
|
||||
public function testExists(): void
|
||||
{
|
||||
$cache = $this->prepare();
|
||||
|
||||
@@ -148,7 +148,7 @@ abstract class CacheTestCase extends TestCase
|
||||
$this->assertFalse($cache->exists('not_exists'));
|
||||
}
|
||||
|
||||
public function testArrayAccess()
|
||||
public function testArrayAccess(): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
@@ -156,21 +156,21 @@ abstract class CacheTestCase extends TestCase
|
||||
$this->assertInstanceOf('stdClass', $cache['arrayaccess_test']);
|
||||
}
|
||||
|
||||
public function testGetValueNonExistent()
|
||||
public function testGetValueNonExistent(): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
$this->assertFalse($this->invokeMethod($cache, 'getValue', ['non_existent_key']));
|
||||
}
|
||||
|
||||
public function testGetNonExistent()
|
||||
public function testGetNonExistent(): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
$this->assertFalse($cache->get('non_existent_key'));
|
||||
}
|
||||
|
||||
public function testStoreSpecialValues()
|
||||
public function testStoreSpecialValues(): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
@@ -181,7 +181,7 @@ abstract class CacheTestCase extends TestCase
|
||||
$this->assertTrue($cache->get('bool_value'));
|
||||
}
|
||||
|
||||
public function testMultiGet()
|
||||
public function testMultiGet(): void
|
||||
{
|
||||
$cache = $this->prepare();
|
||||
|
||||
@@ -191,14 +191,14 @@ abstract class CacheTestCase extends TestCase
|
||||
$this->assertSame(['number_test' => 42, 'non_existent_key' => false], $cache->multiGet(['number_test', 'non_existent_key']));
|
||||
}
|
||||
|
||||
public function testDefaultTtl()
|
||||
public function testDefaultTtl(): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
$this->assertSame(0, $cache->defaultDuration);
|
||||
}
|
||||
|
||||
public function testExpire()
|
||||
public function testExpire(): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
@@ -209,7 +209,7 @@ abstract class CacheTestCase extends TestCase
|
||||
$this->assertFalse($cache->get('expire_test'));
|
||||
}
|
||||
|
||||
public function testExpireAdd()
|
||||
public function testExpireAdd(): void
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
@@ -220,7 +220,7 @@ abstract class CacheTestCase extends TestCase
|
||||
$this->assertFalse($cache->get('expire_testa'));
|
||||
}
|
||||
|
||||
public function testAdd()
|
||||
public function testAdd(): void
|
||||
{
|
||||
$cache = $this->prepare();
|
||||
|
||||
@@ -234,7 +234,7 @@ abstract class CacheTestCase extends TestCase
|
||||
$this->assertEquals(13, $cache->get('add_test'));
|
||||
}
|
||||
|
||||
public function testMultiAdd()
|
||||
public function testMultiAdd(): void
|
||||
{
|
||||
$cache = $this->prepare();
|
||||
|
||||
@@ -249,7 +249,7 @@ abstract class CacheTestCase extends TestCase
|
||||
$this->assertEquals(13, $cache->get('add_test'));
|
||||
}
|
||||
|
||||
public function testDelete()
|
||||
public function testDelete(): void
|
||||
{
|
||||
$cache = $this->prepare();
|
||||
|
||||
@@ -258,14 +258,14 @@ abstract class CacheTestCase extends TestCase
|
||||
$this->assertFalse($cache->get('number_test'));
|
||||
}
|
||||
|
||||
public function testFlush()
|
||||
public function testFlush(): void
|
||||
{
|
||||
$cache = $this->prepare();
|
||||
$this->assertTrue($cache->flush());
|
||||
$this->assertFalse($cache->get('number_test'));
|
||||
}
|
||||
|
||||
public function testGetOrSet()
|
||||
public function testGetOrSet(): void
|
||||
{
|
||||
$cache = $this->prepare();
|
||||
|
||||
@@ -282,7 +282,7 @@ abstract class CacheTestCase extends TestCase
|
||||
return get_class($cache);
|
||||
}
|
||||
|
||||
public function testGetOrSetWithDependencies()
|
||||
public function testGetOrSetWithDependencies(): void
|
||||
{
|
||||
$cache = $this->prepare();
|
||||
$dependency = new TagDependency(['tags' => 'test']);
|
||||
|
||||
Reference in New Issue
Block a user