Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 51... Línea 51...
51
    }
51
    }
Línea 52... Línea 52...
52
 
52
 
53
    /**
53
    /**
54
     * Test that the Moodle APCu store doesn't cross paths with other code using APCu as well.
54
     * Test that the Moodle APCu store doesn't cross paths with other code using APCu as well.
55
     */
55
     */
56
    public function test_cross_application_interaction() {
56
    public function test_cross_application_interaction(): void {
57
        $definition = cache_definition::load_adhoc(cache_store::MODE_APPLICATION, 'cachestore_apcu', 'phpunit_test');
57
        $definition = cache_definition::load_adhoc(cache_store::MODE_APPLICATION, 'cachestore_apcu', 'phpunit_test');
58
        $instance = new cachestore_apcu('Test', cachestore_apcu::unit_test_configuration());
58
        $instance = new cachestore_apcu('Test', cachestore_apcu::unit_test_configuration());
Línea 59... Línea 59...
59
        $instance->initialise($definition);
59
        $instance->initialise($definition);
Línea 70... Línea 70...
70
        $this->assertFalse($instance->get('test'));
70
        $this->assertFalse($instance->get('test'));
71
        $this->assertTrue(apcu_exists('test'));
71
        $this->assertTrue(apcu_exists('test'));
72
        $this->assertSame('pirate', apcu_fetch('test'));
72
        $this->assertSame('pirate', apcu_fetch('test'));
73
    }
73
    }
Línea 74... Línea 74...
74
 
74
 
75
    public function test_different_caches_have_different_prefixes() {
75
    public function test_different_caches_have_different_prefixes(): void {
76
        $definition = cache_definition::load_adhoc(cache_store::MODE_APPLICATION, 'cachestore_apcu', 'phpunit_test');
76
        $definition = cache_definition::load_adhoc(cache_store::MODE_APPLICATION, 'cachestore_apcu', 'phpunit_test');
77
        $instance = new cachestore_apcu('Test', cachestore_apcu::unit_test_configuration());
77
        $instance = new cachestore_apcu('Test', cachestore_apcu::unit_test_configuration());
Línea 78... Línea 78...
78
        $instance->initialise($definition);
78
        $instance->initialise($definition);