Skip to content

Commit

Permalink
MDL-69143 contentbank: fix tests when extra plugins installed
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranrecio committed Jul 29, 2020
1 parent 3dfbd5a commit 910755a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contentbank/tests/contentbank_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ public function test_get_extension_supporter_for_admins(array $supporters, strin
$this->resetAfterTest();

$cb = new contentbank();
$expectedsupporters = [$extension => $expected];

$systemcontext = context_system::instance();

// All contexts allowed for admins.
$this->setAdminUser();
$contextsupporters = $cb->load_context_supported_extensions($systemcontext);
$this->assertEquals($expectedsupporters, $contextsupporters);
$this->assertArrayHasKey($extension, $contextsupporters);
$this->assertEquals($expected, $contextsupporters[$extension]);
}

/**
Expand Down Expand Up @@ -161,7 +161,6 @@ public function test_get_extension_supporter_for_teachers(array $supporters, str
$this->resetAfterTest();

$cb = new contentbank();
$expectedsupporters = [$extension => $expected];

$course = $this->getDataGenerator()->create_course();
$teacher = $this->getDataGenerator()->create_and_enrol($course, 'editingteacher');
Expand All @@ -170,7 +169,8 @@ public function test_get_extension_supporter_for_teachers(array $supporters, str

// Teachers has permission in their context to upload supported by H5P content type.
$contextsupporters = $cb->load_context_supported_extensions($coursecontext);
$this->assertEquals($expectedsupporters, $contextsupporters);
$this->assertArrayHasKey($extension, $contextsupporters);
$this->assertEquals($expected, $contextsupporters[$extension]);
}

/**
Expand Down

0 comments on commit 910755a

Please sign in to comment.