Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 41... Línea 41...
41
 * @package    mod_wiki
41
 * @package    mod_wiki
42
 * @category   test
42
 * @category   test
43
 * @copyright  2018 Marina Glancy
43
 * @copyright  2018 Marina Glancy
44
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
44
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
45
 */
45
 */
46
class provider_test extends provider_testcase {
46
final class provider_test extends provider_testcase {
Línea 47... Línea 47...
47
 
47
 
48
    /** @var array */
48
    /** @var array */
49
    protected $users = [];
49
    protected $users = [];
50
    /** @var array */
50
    /** @var array */
Línea 72... Línea 72...
72
     *   In the export data they have paths:
72
     *   In the export data they have paths:
73
     *   $this->pagepaths[1][1], $this->pagepaths[1][2], $this->pagepaths[1][3]
73
     *   $this->pagepaths[1][1], $this->pagepaths[1][2], $this->pagepaths[1][3]
74
     */
74
     */
75
    public function setUp(): void {
75
    public function setUp(): void {
76
        global $DB;
76
        global $DB;
-
 
77
        parent::setUp();
77
        $this->resetAfterTest();
78
        $this->resetAfterTest();
Línea 78... Línea 79...
78
 
79
 
79
        $dg = $this->getDataGenerator();
80
        $dg = $this->getDataGenerator();
Línea 249... Línea 250...
249
        // Get contexts for the first user.
250
        // Get contexts for the first user.
250
        $contextids = provider::get_contexts_for_userid($this->users[1]->id)->get_contextids();
251
        $contextids = provider::get_contexts_for_userid($this->users[1]->id)->get_contextids();
251
        $this->assertEqualsCanonicalizing([
252
        $this->assertEqualsCanonicalizing([
252
            $this->contexts[1]->id,
253
            $this->contexts[1]->id,
253
            $this->contexts[2]->id,
254
            $this->contexts[2]->id,
254
        ], $contextids);
255
        ], array_values($contextids));
Línea 255... Línea 256...
255
 
256
 
256
        // Get contexts for the second user.
257
        // Get contexts for the second user.
257
        $contextids = provider::get_contexts_for_userid($this->users[2]->id)->get_contextids();
258
        $contextids = provider::get_contexts_for_userid($this->users[2]->id)->get_contextids();
258
        $this->assertEqualsCanonicalizing([
259
        $this->assertEqualsCanonicalizing([
259
            $this->contexts[1]->id,
260
            $this->contexts[1]->id,
260
            $this->contexts[2]->id,
261
            $this->contexts[2]->id,
261
            $this->contexts[3]->id,
262
            $this->contexts[3]->id,
Línea 262... Línea 263...
262
        ], $contextids);
263
        ], array_values($contextids));
263
 
264
 
264
        // Get contexts for the third user.
265
        // Get contexts for the third user.
265
        $contextids = provider::get_contexts_for_userid($this->users[3]->id)->get_contextids();
266
        $contextids = provider::get_contexts_for_userid($this->users[3]->id)->get_contextids();
266
        $this->assertEqualsCanonicalizing([
267
        $this->assertEqualsCanonicalizing([
267
            $this->contexts[1]->id,
268
            $this->contexts[1]->id,
268
            $this->contexts[2]->id,
269
            $this->contexts[2]->id,
269
            $this->contexts[3]->id,
270
            $this->contexts[3]->id,
Línea 270... Línea 271...
270
        ], $contextids);
271
        ], array_values($contextids));
271
    }
272
    }
272
 
273