Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 69... Línea 69...
69
    }
69
    }
Línea 70... Línea 70...
70
 
70
 
71
    /**
71
    /**
72
     * It misses a value.
72
     * It misses a value.
73
     */
73
     */
74
    public function test_it_can_miss_one() {
74
    public function test_it_can_miss_one(): void {
Línea 75... Línea 75...
75
        $store = $this->create_store(cachestore_redis::COMPRESSOR_PHP_GZIP, \Redis::SERIALIZER_PHP);
75
        $store = $this->create_store(cachestore_redis::COMPRESSOR_PHP_GZIP, \Redis::SERIALIZER_PHP);
76
 
76
 
Línea 77... Línea 77...
77
        self::assertFalse($store->get('missme'));
77
        self::assertFalse($store->get('missme'));
78
    }
78
    }
79
 
79
 
80
    /**
80
    /**
81
     * It misses many values.
81
     * It misses many values.
Línea 82... Línea 82...
82
     */
82
     */
83
    public function test_it_can_miss_many() {
83
    public function test_it_can_miss_many(): void {
84
        $store = $this->create_store(cachestore_redis::COMPRESSOR_PHP_GZIP, \Redis::SERIALIZER_PHP);
84
        $store = $this->create_store(cachestore_redis::COMPRESSOR_PHP_GZIP, \Redis::SERIALIZER_PHP);
85
 
85
 
Línea 86... Línea 86...
86
        $expected = ['missme' => false, 'missmetoo' => false];
86
        $expected = ['missme' => false, 'missmetoo' => false];
87
        $actual = $store->get_many(array_keys($expected));
87
        $actual = $store->get_many(array_keys($expected));
88
        self::assertSame($expected, $actual);
88
        self::assertSame($expected, $actual);
89
    }
89
    }
90
 
90
 
91
    /**
91
    /**
Línea 92... Línea 92...
92
     * It misses some values.
92
     * It misses some values.
93
     */
93
     */
Línea 132... Línea 132...
132
     *
132
     *
133
     * @dataProvider provider_for_test_it_works_with_different_types
133
     * @dataProvider provider_for_test_it_works_with_different_types
134
     * @param string $key
134
     * @param string $key
135
     * @param mixed $value
135
     * @param mixed $value
136
     */
136
     */
137
    public function test_it_works_with_different_types($key, $value) {
137
    public function test_it_works_with_different_types($key, $value): void {
138
        $store = $this->create_store(cachestore_redis::COMPRESSOR_PHP_GZIP, \Redis::SERIALIZER_PHP);
138
        $store = $this->create_store(cachestore_redis::COMPRESSOR_PHP_GZIP, \Redis::SERIALIZER_PHP);
139
        $store->set($key, $value);
139
        $store->set($key, $value);
Línea 140... Línea 140...
140
 
140
 
141
        self::assertEquals($value, $store->get($key), "Failed set/get for: {$key}");
141
        self::assertEquals($value, $store->get($key), "Failed set/get for: {$key}");
Línea 142... Línea 142...
142
    }
142
    }
143
 
143
 
144
    /**
144
    /**
145
     * Test it works with different types for many.
145
     * Test it works with different types for many.
146
     */
146
     */
Línea 147... Línea 147...
147
    public function test_it_works_with_different_types_for_many() {
147
    public function test_it_works_with_different_types_for_many(): void {
148
        $store = $this->create_store(cachestore_redis::COMPRESSOR_PHP_GZIP, \Redis::SERIALIZER_PHP);
148
        $store = $this->create_store(cachestore_redis::COMPRESSOR_PHP_GZIP, \Redis::SERIALIZER_PHP);
149
 
149
 
Línea 232... Línea 232...
232
     * @param int $serializer
232
     * @param int $serializer
233
     * @param int $compressor
233
     * @param int $compressor
234
     * @param string $rawexpected1
234
     * @param string $rawexpected1
235
     * @param string $rawexpected2
235
     * @param string $rawexpected2
236
     */
236
     */
237
    public function test_it_can_use_getset($name, $serializer, $compressor, $rawexpected1, $rawexpected2) {
237
    public function test_it_can_use_getset($name, $serializer, $compressor, $rawexpected1, $rawexpected2): void {
238
        // Create a connection with the desired serialisation.
238
        // Create a connection with the desired serialisation.
239
        $store = $this->create_store($compressor, $serializer);
239
        $store = $this->create_store($compressor, $serializer);
240
        $store->set('key', 'value1');
240
        $store->set('key', 'value1');
Línea 241... Línea 241...
241
 
241
 
Línea 256... Línea 256...
256
     * @param int $serializer
256
     * @param int $serializer
257
     * @param int $compressor
257
     * @param int $compressor
258
     * @param string $rawexpected1
258
     * @param string $rawexpected1
259
     * @param string $rawexpected2
259
     * @param string $rawexpected2
260
     */
260
     */
261
    public function test_it_can_use_getsetmany($name, $serializer, $compressor, $rawexpected1, $rawexpected2) {
261
    public function test_it_can_use_getsetmany($name, $serializer, $compressor, $rawexpected1, $rawexpected2): void {
262
        $many = [
262
        $many = [
263
            ['key' => 'key1', 'value' => 'value1'],
263
            ['key' => 'key1', 'value' => 'value1'],
264
            ['key' => 'key2', 'value' => 'value2'],
264
            ['key' => 'key2', 'value' => 'value2'],
265
        ];
265
        ];
266
        $keys = ['key1', 'key2'];
266
        $keys = ['key1', 'key2'];