Skip to content

Commit

Permalink
MDL-70102 PHPunit: Core test fails with weird added modules
Browse files Browse the repository at this point in the history
Specifically it fails if the modules have unusual default capabilities
so that editingteacher doesn't have addinstance.
  • Loading branch information
sammarshallou committed Jan 7, 2021
1 parent 56fd8c5 commit b5568aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion course/tests/services_content_item_service_test.php
Expand Up @@ -121,7 +121,8 @@ public function test_get_all_content_items() {

// The call to get_all_content_items() should return the same items as for the course,
// given the user in an editing teacher and can add manual lti instances.
$this->assertEquals(array_column($allcontentitems, 'name'), array_column($coursecontentitems, 'name'));
$this->assertContains('lti', array_column($coursecontentitems, 'name'));
$this->assertContains('lti', array_column($allcontentitems, 'name'));

// Now removing the cap 'mod/lti:addinstance'. This will restrict those items returned by the course-specific method.
$teacherrole = $DB->get_record('role', array('shortname' => 'editingteacher'));
Expand Down

0 comments on commit b5568aa

Please sign in to comment.