Merge branch '45699-29' of git://github.com/samhemelryk/moodle
Conflicts: cache/upgrade.txt
This commit is contained in:
Vendored
+39
-39
@@ -47,7 +47,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
cache_factory::reset();
|
||||
cache_config_phpunittest::create_default_configuration();
|
||||
cache_config_testing::create_default_configuration();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,9 +114,9 @@ class core_cache_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
$instance = cache_config::instance();
|
||||
$this->assertInstanceOf('cache_config_phpunittest', $instance);
|
||||
$this->assertInstanceOf('cache_config_testing', $instance);
|
||||
|
||||
$this->assertTrue(cache_config_phpunittest::config_file_exists());
|
||||
$this->assertTrue(cache_config_testing::config_file_exists());
|
||||
|
||||
$stores = $instance->get_all_stores();
|
||||
$this->assertCount(3, $stores);
|
||||
@@ -174,7 +174,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Tests for cache keys that would break on windows.
|
||||
*/
|
||||
public function test_windows_nasty_keys() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/windowskeytest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -195,7 +195,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
$this->assertInstanceOf('cache_application', $cache);
|
||||
$this->run_on_cache($cache);
|
||||
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/test_default_application_cache', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -230,7 +230,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Tests using a cache system when there are no stores available (who knows what the admin did to achieve this).
|
||||
*/
|
||||
public function test_on_cache_without_store() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/nostoretest1', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -459,7 +459,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Tests a definition using a data loader
|
||||
*/
|
||||
public function test_definition_data_loader() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/datasourcetest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -500,7 +500,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Tests a definition using an overridden loader
|
||||
*/
|
||||
public function test_definition_overridden_loader() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/overridetest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -525,8 +525,8 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Test the mappingsonly setting.
|
||||
*/
|
||||
public function test_definition_mappings_only() {
|
||||
/** @var cache_config_phpunittest $instance */
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
/** @var cache_config_testing $instance */
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/mappingsonly', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -554,7 +554,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Test a very basic definition.
|
||||
*/
|
||||
public function test_definition() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/test', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -572,7 +572,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Test a definition using the simple keys.
|
||||
*/
|
||||
public function test_definition_simplekeys() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/simplekeytest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -598,7 +598,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Test a negative TTL on an application cache.
|
||||
*/
|
||||
public function test_application_ttl_negative() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/ttltest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -647,7 +647,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Test a positive TTL on an application cache.
|
||||
*/
|
||||
public function test_application_ttl_positive() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/ttltest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -696,7 +696,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Test a negative TTL on an session cache.
|
||||
*/
|
||||
public function test_session_ttl_positive() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/ttltest', array(
|
||||
'mode' => cache_store::MODE_SESSION,
|
||||
'component' => 'phpunit',
|
||||
@@ -745,7 +745,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Tests manual locking operations on an application cache
|
||||
*/
|
||||
public function test_application_manual_locking() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/lockingtest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -774,7 +774,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Tests application cache event invalidation
|
||||
*/
|
||||
public function test_application_event_invalidation() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/eventinvalidationtest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -809,7 +809,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Tests session cache event invalidation
|
||||
*/
|
||||
public function test_session_event_invalidation() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/test_session_event_invalidation', array(
|
||||
'mode' => cache_store::MODE_SESSION,
|
||||
'component' => 'phpunit',
|
||||
@@ -845,7 +845,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Tests application cache definition invalidation
|
||||
*/
|
||||
public function test_application_definition_invalidation() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/definitioninvalidation', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -881,7 +881,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Tests session cache definition invalidation
|
||||
*/
|
||||
public function test_session_definition_invalidation() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/test_session_definition_invalidation', array(
|
||||
'mode' => cache_store::MODE_SESSION,
|
||||
'component' => 'phpunit',
|
||||
@@ -925,7 +925,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
// We need to add data the to cache, invalidate it by event, manually force it back without MUC knowing to simulate a
|
||||
// disconnected/distributed setup (think load balanced server using local cache), instantiate the cache again and finally
|
||||
// check that it is not picked up.
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/eventinvalidationtest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -963,7 +963,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
|
||||
// Test 1: Rebuild without the event and test its there.
|
||||
cache_factory::reset();
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/eventinvalidationtest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -976,7 +976,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
|
||||
// Test 2: Rebuild and test the invalidation of the event via the invalidation cache.
|
||||
cache_factory::reset();
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/eventinvalidationtest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -995,7 +995,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Tests application cache event purge
|
||||
*/
|
||||
public function test_application_event_purge() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/eventpurgetest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -1046,7 +1046,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Tests session cache event purge
|
||||
*/
|
||||
public function test_session_event_purge() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/eventpurgetest', array(
|
||||
'mode' => cache_store::MODE_SESSION,
|
||||
'component' => 'phpunit',
|
||||
@@ -1097,7 +1097,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Tests application cache definition purge
|
||||
*/
|
||||
public function test_application_definition_purge() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/definitionpurgetest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -1132,7 +1132,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
}
|
||||
$this->resetAfterTest();
|
||||
$CFG->altcacheconfigpath = $CFG->dataroot.'/cache/altcacheconfigpath';
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$this->assertInstanceOf('cache_config', $instance);
|
||||
}
|
||||
|
||||
@@ -1140,7 +1140,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Test disabling the cache stores.
|
||||
*/
|
||||
public function test_disable_stores() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/disabletest1', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -1269,14 +1269,14 @@ class core_cache_testcase extends advanced_testcase {
|
||||
|
||||
$factory = cache_factory::instance(true);
|
||||
$config = $factory->create_config_instance();
|
||||
$this->assertEquals('cache_config_phpunittest', get_class($config));
|
||||
$this->assertEquals('cache_config_testing', get_class($config));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that multiple application loaders work ok.
|
||||
*/
|
||||
public function test_multiple_application_loaders() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_file_store('phpunittest1');
|
||||
$instance->phpunit_add_file_store('phpunittest2');
|
||||
$instance->phpunit_add_definition('phpunit/multi_loader', array(
|
||||
@@ -1344,8 +1344,8 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Test that multiple application loaders work ok.
|
||||
*/
|
||||
public function test_multiple_session_loaders() {
|
||||
/* @var cache_config_phpunittest $instance */
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
/* @var cache_config_testing $instance */
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_session_store('phpunittest1');
|
||||
$instance->phpunit_add_session_store('phpunittest2');
|
||||
$instance->phpunit_add_definition('phpunit/multi_loader', array(
|
||||
@@ -1442,7 +1442,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
*/
|
||||
public function test_session_cache_switch_user_application_mapping() {
|
||||
$this->resetAfterTest(true);
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_file_store('testfilestore');
|
||||
$instance->phpunit_add_definition('phpunit/testappsession', array(
|
||||
'mode' => cache_store::MODE_SESSION,
|
||||
@@ -1477,7 +1477,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Test two session caches being used at once to confirm collisions don't occur.
|
||||
*/
|
||||
public function test_dual_session_caches() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/testsess1', array(
|
||||
'mode' => cache_store::MODE_SESSION,
|
||||
'component' => 'phpunit',
|
||||
@@ -1542,7 +1542,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Test application locking.
|
||||
*/
|
||||
public function test_application_locking() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/test_application_locking', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -1568,7 +1568,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Test the static cache_helper method purge_stores_used_by_definition.
|
||||
*/
|
||||
public function test_purge_stores_used_by_definition() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/test_purge_stores_used_by_definition', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -1590,7 +1590,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Test purge routines.
|
||||
*/
|
||||
public function test_purge_routines() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/purge1', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -1637,7 +1637,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
* Test that the default stores all support searching.
|
||||
*/
|
||||
public function test_defaults_support_searching() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance = cache_config_testing::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/search1', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
@@ -1684,7 +1684,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
public function test_static_acceleration() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance = cache_config_testing::instance();
|
||||
$instance->phpunit_add_definition('phpunit/accelerated', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
|
||||
Reference in New Issue
Block a user