-
Bug
-
Resolution: Fixed
-
Minor
-
2.8.1, 2.9
-
MOODLE_28_STABLE, MOODLE_29_STABLE
-
MOODLE_28_STABLE
-
48568-29
-
While testing MDL-37072 different combinations, I came to:
1) Setting this into config.php:
define('TEST_CACHESTORE_MONGODB_TESTSERVER', 'mongodb://localhost:27017');
|
define('TEST_CACHE_USING_APPLICATION_STORE', 'mongodb');
|
Leads to failure:
vendor/bin/phpunit core_cache_testcase cache/tests/cache_test.php
|
Moodle 2.9dev (Build: 20141205), pgsql, c9d507886984ca85a3024d3f680d118445789836
|
PHPUnit 3.7.38 by Sebastian Bergmann.
|
|
Configuration read from /Users/stronk7/git_moodle/integration/phpunit.xml
|
|
S.......F............................
|
|
Time: 2.45 seconds, Memory: 58.25Mb
|
|
There was 1 failure:
|
|
1) core_cache_testcase::test_definition_mappings_only
|
Failed asserting that two strings are equal.
|
--- Expected
|
+++ Actual
|
@@ @@
|
-'cachestore_mongodb'
|
+'cachestore_file'
|
|
/Users/stronk7/git_moodle/integration/cache/tests/cache_test.php:526
|
/Users/stronk7/git_moodle/integration/lib/phpunit/classes/advanced_testcase.php:80
|
|
To re-run:
|
vendor/bin/phpunit core_cache_testcase cache/tests/cache_test.php
|
|
FAILURES!
|
Tests: 37, Assertions: 1120, Failures: 1, Skipped: 1.
|
Tracing down the problem, it seems that, for MONGODB we are using a singular define (TEST_CACHESTORE_MONGODB_TESTSERVER) but in cache/tests/fixtures/lib.php we are assuming (concatenating) to a plural "_TESTSERVERS" define.
Hence it does not find the expected singular define, and default file store is used, leading to the unit test above failing.
To confirm it, I've run the tests with both (singular and plural) defines and they passed.
So this should be as simple as replacing all singular occurrences of TEST_CACHESTORE_MONGODB_TESTSERVER to plural. Code base and docs.
Ciao