Skip to content
Browse files

MDL-38247 cache: Improved documentation

  • Loading branch information...
1 parent 32c981e commit 11cfc0f95e9893bf17ff2e3c06b3e547f5b1a14c Sam Hemelryk committed Feb 28, 2013
View
11 cache/README.md
@@ -226,3 +226,14 @@ The first method is designed to be used when you have a single known definition
The second method is a lot more intensive for the system. There are defined invalidation events that definitions can "subscribe" to (through the definitions invalidationevents option).
When you invalidate by event the cache API finds all of the definitions that subscribe to the event, it then loads the stores for each of those definitions and purges the keys from each store.
This is obviously a recursive, and therefore, intense process.
+
+### Unit tests
+Both the cache API and the cache stores have unit tests.
+Please be aware that several of the cache stores require configuration in order to be able operate in the unit tests.
+Tests for stores requiring configuration that havn't been configured will be skipped.
+All configuration is done in your sites config.php through definitions.
+The following snippet illustates how to configure the three core cache stores that require configuration.
+
+ define('TEST_CACHESTORE_MEMCACHE_TESTSERVERS', '127.0.0.1:11211');
+ define('TEST_CACHESTORE_MEMCACHED_TESTSERVERS', '127.0.0.1:11211');
+ define('TEST_CACHESTORE_MONGODB_TESTSERVER', 'mongodb://localhost:27017');
View
7 cache/stores/memcache/tests/memcache_test.php
@@ -15,7 +15,12 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * Memcache unit tests
+ * Memcache unit tests.
+ *
+ * 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_MEMCACHE_TESTSERVERS', '127.0.0.1:11211');
*
* @package cachestore_memcache
* @copyright 2013 Sam Hemelryk
View
7 cache/stores/memcached/tests/memcached_test.php
@@ -15,7 +15,12 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * Memcached unit tests
+ * Memcached unit tests.
+ *
+ * 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_MEMCACHED_TESTSERVERS', '127.0.0.1:11211');
*
* @package cachestore_memcached
* @copyright 2013 Sam Hemelryk
View
7 cache/stores/mongodb/tests/mongodb_test.php
@@ -15,7 +15,12 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * MongoDB unit tests
+ * MongoDB unit tests.
+ *
+ * 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_MONGODB_TESTSERVER', 'mongodb://localhost:27017');
*
* @package cachestore_mongodb
* @copyright 2013 Sam Hemelryk

0 comments on commit 11cfc0f

Please sign in to comment.
Something went wrong with that request. Please try again.