Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

(no description)

File Size: 288 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 2 files
 cache/tests/fixtures/stores.php
 cache/stores/redis/lib.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