New helper ApiTestCase::setExpectedApiException()
authorAryeh Gregor <ayg@aryeh.name>
Tue, 31 Jul 2018 13:19:10 +0000 (16:19 +0300)
committerReedy <reedy@wikimedia.org>
Thu, 25 Apr 2019 14:50:14 +0000 (15:50 +0100)
commit2f6c4da1aead080b8b390b5c9d419bd36b15bf03
tree98e43c400be373643dd420abc01b38e4099f5c03
parentea2f3d1c3adfa62b67f905d2795bc997b424a3f8
New helper ApiTestCase::setExpectedApiException()

This allows setting the expected exception message by the message key,
not text, so it remains correct if the message is updated.  This
function could be defined to work with other exception types too, but it
seems useful to have shortcuts for common types like ApiUsageException
or MWException.

Change-Id: Ic86278e9e1e91eea0c045d2b93342f018e1d8e66
tests/phpunit/includes/api/ApiTestCase.php