diff --git a/group/tests/externallib_test.php b/group/tests/externallib_test.php index dcbb0ef2742..fff4079f1e7 100644 --- a/group/tests/externallib_test.php +++ b/group/tests/externallib_test.php @@ -106,9 +106,8 @@ class core_group_externallib_testcase extends externallib_advanced_testcase { $froups = core_group_external::create_groups(array($group3)); $this->fail('Exception expected due to already existing idnumber.'); } catch (moodle_exception $e) { - $this->assertInstanceOf('invalid_parameter_exception', $e); - $this->assertEquals('Invalid parameter value detected (Group with the same idnumber already exists)', - $e->getMessage()); + $this->assertInstanceOf('moodle_exception', $e); + $this->assertEquals(get_string('idnumbertaken', 'error'), $e->getMessage()); } // Call without required capability @@ -258,9 +257,8 @@ class core_group_externallib_testcase extends externallib_advanced_testcase { $groupings = core_group_external::create_groupings(array($grouping1data)); $this->fail('Exception expected due to already existing idnumber.'); } catch (moodle_exception $e) { - $this->assertInstanceOf('invalid_parameter_exception', $e); - $this->assertEquals('Invalid parameter value detected (Grouping with the same idnumber already exists)', - $e->getMessage()); + $this->assertInstanceOf('moodle_exception', $e); + $this->assertEquals(get_string('idnumbertaken', 'error'), $e->getMessage()); } // No exception should be triggered. @@ -285,9 +283,8 @@ class core_group_externallib_testcase extends externallib_advanced_testcase { $groupings = core_group_external::update_groupings(array($grouping2data)); $this->fail('Exception expected due to already existing idnumber.'); } catch (moodle_exception $e) { - $this->assertInstanceOf('invalid_parameter_exception', $e); - $this->assertEquals('Invalid parameter value detected (A different grouping with the same idnumber already exists)', - $e->getMessage()); + $this->assertInstanceOf('moodle_exception', $e); + $this->assertEquals(get_string('idnumbertaken', 'error'), $e->getMessage()); } }