19declare(strict_types=1);
21use PHPUnit\Framework\TestCase;
22use PHPUnit\Framework\Attributes\DataProvider;
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]],
47 'Object Type' => [
new stdClass()],
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));
testExceptionIsRaisedWhenTryingToRetrieveItemNotCachedYet()
static scalarValuesAndNullProvider()
static nonScalarValuesProvider()
testCacheItemResultsInCacheHit()
testExceptionIsRaisedWhenKeyShouldBeBuiltWithNonScalarValues(mixed $nonScalarValue)
testCacheKeyCouldBeGeneratedByArray($scalarValue)
Class ilForumNotificationCache.