Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 42... Línea 42...
42
    /**
42
    /**
43
     * Engine basic info.
43
     * Engine basic info.
44
     *
44
     *
45
     * @return void
45
     * @return void
46
     */
46
     */
47
    public function test_engine_info() {
47
    public function test_engine_info(): void {
48
        $engine = new \mock_search\engine();
48
        $engine = new \mock_search\engine();
Línea 49... Línea 49...
49
 
49
 
Línea 50... Línea 50...
50
        $this->assertEquals('mock_search', $engine->get_plugin_name());
50
        $this->assertEquals('mock_search', $engine->get_plugin_name());
Línea 56... Línea 56...
56
    /**
56
    /**
57
     * Test engine caches.
57
     * Test engine caches.
58
     *
58
     *
59
     * @return void
59
     * @return void
60
     */
60
     */
61
    public function test_engine_caches() {
61
    public function test_engine_caches(): void {
62
        global $DB;
62
        global $DB;
Línea 63... Línea 63...
63
 
63
 
Línea 64... Línea 64...
64
        $engine = new \mock_search\engine();
64
        $engine = new \mock_search\engine();
Línea 84... Línea 84...
84
    }
84
    }
Línea 85... Línea 85...
85
 
85
 
86
    /**
86
    /**
87
     * Tests the core functions related to schema updates.
87
     * Tests the core functions related to schema updates.
88
     */
88
     */
89
    public function test_engine_schema_modification() {
89
    public function test_engine_schema_modification(): void {
90
        // Apply a schema update starting from no version.
90
        // Apply a schema update starting from no version.
91
        $engine = new \mock_search\engine();
91
        $engine = new \mock_search\engine();
92
        $engine->check_latest_schema();
92
        $engine->check_latest_schema();
93
        $updates = $engine->get_and_clear_schema_updates();
93
        $updates = $engine->get_and_clear_schema_updates();
Línea 115... Línea 115...
115
    }
115
    }
Línea 116... Línea 116...
116
 
116
 
117
    /**
117
    /**
118
     * Tests the get_supported_orders stub function.
118
     * Tests the get_supported_orders stub function.
119
     */
119
     */
120
    public function test_get_supported_orders() {
120
    public function test_get_supported_orders(): void {
121
        $engine = new \mock_search\engine();
121
        $engine = new \mock_search\engine();
122
        $orders = $engine->get_supported_orders(\context_system::instance());
122
        $orders = $engine->get_supported_orders(\context_system::instance());
123
        $this->assertCount(1, $orders);
123
        $this->assertCount(1, $orders);
124
        $this->assertArrayHasKey('relevance', $orders);
124
        $this->assertArrayHasKey('relevance', $orders);
Línea 125... Línea 125...
125
    }
125
    }
126
 
126
 
127
    /**
127
    /**
128
     * Test that search engine sets an icon before render a document.
128
     * Test that search engine sets an icon before render a document.
129
     */
129
     */
130
    public function test_engine_sets_doc_icon() {
130
    public function test_engine_sets_doc_icon(): void {
Línea 131... Línea 131...
131
        $generator = self::getDataGenerator()->get_plugin_generator('core_search');
131
        $generator = self::getDataGenerator()->get_plugin_generator('core_search');
132
        $generator->setup();
132
        $generator->setup();