Skip to content

Commit

Permalink
handle language cannot be downloaded errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rdebleu committed Dec 17, 2023
1 parent 884938c commit cc4c730
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/condition_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ public function setUp():void {
public function test_in_tree(): void {
$this->resetAfterTest();
$controller = new \tool_langimport\controller();
$controller->install_languagepacks('nl');

try {
$controller->install_languagepacks('nl');
} catch (\Exception $e) {
// We cannot be 100% sure the language can be downloaded.
$this->markTestSkipped($e->getMessage());
return;
}
// Create course with language turned on and a Page.
set_config('enableavailability', true);
$generator = $this->getDataGenerator();
Expand Down

0 comments on commit cc4c730

Please sign in to comment.