Skip to content

Replace deprecated PHPUnit expectExceptionMessage() with expectExceptionObject() - #158

Merged
Soner (shyim) merged 1 commit into
trunkfrom
copilot/refactor-in-app-purchases-tests
May 23, 2026
Merged

Replace deprecated PHPUnit expectExceptionMessage() with expectExceptionObject()#158
Soner (shyim) merged 1 commit into
trunkfrom
copilot/refactor-in-app-purchases-tests

Conversation

Copilot AI commented May 23, 2026

Copy link
Copy Markdown
Contributor

expectExceptionMessage() is soft-deprecated in PHPUnit 13.2 and scheduled for removal in 15.0. Two usages in InAppPurchasesControllerTest triggered PHPStan warnings.

Changes

  • tests/Controller/InAppPurchasesControllerTest.php: Replace both expectException() + expectExceptionMessage() pairs with expectExceptionObject(), using the existing factory methods on ExtensionStoreException:
// Before
$this->expectException(ExtensionStoreException::class);
$this->expectExceptionMessage('The extension with technical name "otherExtension" is not known.');

// After
$this->expectExceptionObject(ExtensionStoreException::unknownExtension('otherExtension'));

@shyim
Soner (shyim) marked this pull request as ready for review May 23, 2026 04:26
@shyim
Soner (shyim) merged commit a728008 into trunk May 23, 2026
6 checks passed
@shyim
Soner (shyim) deleted the copilot/refactor-in-app-purchases-tests branch May 23, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants