Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 35... Línea 35...
35
 * @category   external
35
 * @category   external
36
 * @copyright  2016 Pau Ferrer <pau@moodle.com>
36
 * @copyright  2016 Pau Ferrer <pau@moodle.com>
37
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
37
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
38
 * @since      Moodle 3.1
38
 * @since      Moodle 3.1
39
 */
39
 */
40
class externallib_test extends externallib_advanced_testcase {
40
final class externallib_test extends externallib_advanced_testcase {
Línea 41... Línea 41...
41
 
41
 
42
    /** @var \stdClass course record. */
42
    /** @var \stdClass course record. */
Línea 43... Línea 43...
43
    protected $course;
43
    protected $course;
Línea 51... Línea 51...
51
    /**
51
    /**
52
     * Set up for every test
52
     * Set up for every test
53
     */
53
     */
54
    public function setUp(): void {
54
    public function setUp(): void {
55
        global $DB;
55
        global $DB;
-
 
56
        parent::setUp();
56
        $this->resetAfterTest();
57
        $this->resetAfterTest();
57
        $this->setAdminUser();
58
        $this->setAdminUser();
Línea 58... Línea 59...
58
 
59
 
59
        // Setup test data.
60
        // Setup test data.
Línea 110... Línea 111...
110
    }
111
    }
Línea 111... Línea 112...
111
 
112
 
112
    /**
113
    /**
113
     * Data provider for the get_random_question_summaries test.
114
     * Data provider for the get_random_question_summaries test.
114
     */
115
     */
115
    public function get_random_question_summaries_test_cases() {
116
    public static function get_random_question_summaries_test_cases(): array {
116
        return [
117
        return [
117
            'empty category' => [
118
            'empty category' => [
118
                'categoryindex' => 'emptycat',
119
                'categoryindex' => 'emptycat',
119
                'includesubcategories' => false,
120
                'includesubcategories' => false,
Línea 182... Línea 183...
182
     *              Tags: 'subcat', 'foo'
183
     *              Tags: 'subcat', 'foo'
183
     *          Question: subcatq2
184
     *          Question: subcatq2
184
     *          Parent: cat1
185
     *          Parent: cat1
185
     *      Category: emptycat
186
     *      Category: emptycat
186
     *
187
     *
187
     * @dataProvider get_random_question_summaries_test_cases()
188
     * @dataProvider get_random_question_summaries_test_cases
188
     * @param string $categoryindex The named index for the category to use
189
     * @param string $categoryindex The named index for the category to use
189
     * @param bool $includesubcategories If the search should include subcategories
190
     * @param bool $includesubcategories If the search should include subcategories
190
     * @param string[] $usetagnames The tag names to include in the search
191
     * @param string[] $usetagnames The tag names to include in the search
191
     * @param string[] $expectedquestionindexes The questions expected in the result
192
     * @param string[] $expectedquestionindexes The questions expected in the result
192
     */
193
     */