19 declare(strict_types=1);
28 $this->expectException(InvalidArgumentException::class);
31 $cache->fetch(
'item');
37 $cache->store(
'item',
'ilias');
39 $this->assertTrue($cache->exists(
'item'));
40 $this->assertSame(
'ilias', $cache->fetch(
'item'));
46 'Array Type' => [[4]],
48 'Ressource Type' => [fopen(
'php://temp',
'rb')]
52 #[DataProvider('nonScalarValuesProvider')] 55 $this->expectException(InvalidArgumentException::class);
58 $cache->createKeyByValues([$nonScalarValue, $nonScalarValue]);
64 'Float Type' => [4.0],
65 'String Type' => [
'4'],
66 'Boolean Type' => [
false],
67 'Integer Type' => [4],
68 'Null Type' => [
null],
75 #[DataProvider('scalarValuesAndNullProvider')] 79 $key = $cache->createKeyByValues([$scalarValue, $scalarValue]);
81 $this->assertNotEmpty($key);
82 $this->assertSame(32, strlen($key));
testCacheKeyCouldBeGeneratedByArray($scalarValue)
static nonScalarValuesProvider()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
testCacheItemResultsInCacheHit()
Class ilForumNotificationCache.
static scalarValuesAndNullProvider()
testExceptionIsRaisedWhenKeyShouldBeBuiltWithNonScalarValues(mixed $nonScalarValue)
testExceptionIsRaisedWhenTryingToRetrieveItemNotCachedYet()