Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 39 and 401]

(no description)

File Size: 288 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 2 files
 cache/stores/redis/lib.php
 cache/tests/fixtures/stores.php

Defines 1 class


Class: compressor_test  - X-Ref

Redis cache test - compressor settings.

If you wish to use these unit tests all you need to do is add the following definition to
your config.php file.

define('TEST_CACHESTORE_REDIS_TESTSERVERS', '127.0.0.1');

setUp()   X-Ref
Test set up


create_store($compressor, $serializer)   X-Ref
Create a cachestore.

param: int $compressor
param: int $serializer
return: cachestore_redis

test_it_can_miss_one()   X-Ref
It misses a value.


test_it_can_miss_many()   X-Ref
It misses many values.


test_it_can_miss_some()   X-Ref
It misses some values.


provider_for_test_it_works_with_different_types()   X-Ref
A provider for test_works_with_different_types

return: array

test_it_works_with_different_types($key, $value)   X-Ref
It works with different types.

param: string $key
param: mixed $value

test_it_works_with_different_types_for_many()   X-Ref
Test it works with different types for many.


provider_for_tests_setget()   X-Ref
Provider for set/get combination tests.

return: array

test_it_can_use_getset($name, $serializer, $compressor, $rawexpected1, $rawexpected2)   X-Ref
Test we can use get and set with all combinations.

param: string $name
param: int $serializer
param: int $compressor
param: string $rawexpected1
param: string $rawexpected2

test_it_can_use_getsetmany($name, $serializer, $compressor, $rawexpected1, $rawexpected2)   X-Ref
Test we can use get and set many with all combinations.

param: string $name
param: int $serializer
param: int $compressor
param: string $rawexpected1
param: string $rawexpected2