Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 30... Línea 30...
30
 * @category    test
30
 * @category    test
31
 * @copyright   2016 Eric Merrill {@link http://www.merrilldigital.com}
31
 * @copyright   2016 Eric Merrill {@link http://www.merrilldigital.com}
32
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
32
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
33
 * @coversDefaultClass \core_search\document
33
 * @coversDefaultClass \core_search\document
34
 */
34
 */
35
class document_test extends \advanced_testcase {
35
final class document_test extends \advanced_testcase {
Línea 36... Línea 36...
36
 
36
 
37
    /**
37
    /**
38
     * Setup to ensure that fixtures are loaded.
38
     * Setup to ensure that fixtures are loaded.
39
     */
39
     */
Línea 47... Línea 47...
47
     * @var Instace of core_search_generator.
47
     * @var Instace of core_search_generator.
48
     */
48
     */
49
    protected $generator = null;
49
    protected $generator = null;
Línea 50... Línea 50...
50
 
50
 
-
 
51
    public function setUp(): void {
51
    public function setUp(): void {
52
        parent::setUp();
52
        $this->resetAfterTest();
53
        $this->resetAfterTest();
Línea 53... Línea 54...
53
        set_config('enableglobalsearch', true);
54
        set_config('enableglobalsearch', true);
54
 
55
 
Línea 132... Línea 133...
132
        if ($this->generator) {
133
        if ($this->generator) {
133
            // Moodle DML freaks out if we don't teardown the temp table after each run.
134
            // Moodle DML freaks out if we don't teardown the temp table after each run.
134
            $this->generator->teardown();
135
            $this->generator->teardown();
135
            $this->generator = null;
136
            $this->generator = null;
136
        }
137
        }
-
 
138
        parent::tearDown();
137
    }
139
    }
Línea 138... Línea 140...
138
 
140
 
139
    /**
141
    /**
140
     * Test the document author visibility depending on the user capabilities.
142
     * Test the document author visibility depending on the user capabilities.
Línea 209... Línea 211...
209
    /**
211
    /**
210
     * Data provider for test_document_author_visibility().
212
     * Data provider for test_document_author_visibility().
211
     *
213
     *
212
     * @return array
214
     * @return array
213
     */
215
     */
214
    public function document_author_visibility_provider(): array {
216
    public static function document_author_visibility_provider(): array {
215
        return [
217
        return [
216
            'Teacher' => [
218
            'Teacher' => [
217
                'rolename' => 'editingteacher',
219
                'rolename' => 'editingteacher',
218
                'capexceptions' => [],
220
                'capexceptions' => [],
219
                'expected' => true,
221
                'expected' => true,