Skip to content

Fix syntax of expectException() calls #11068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

Fix syntax of expectException() calls #11068

wants to merge 4 commits into from

Conversation

schmengler
Copy link
Contributor

@schmengler schmengler commented Sep 26, 2017

Description

RegEx search and replace from ( *)\$this->expectException\(([^\n,]+), ([^)\n]+)\); to $1\$this->expectException($2);\n$1\$this->expectExceptionMessage($3);

Fixed Issues (if relevant)

  1. 92 usages of expectException() with ignored $message parameter #11059: 92 usages of expectException() with ignored $message parameter

Manual testing scenarios

  1. Change an exception message that should be covered by a test

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

heyitsroberthe and others added 4 commits September 12, 2017 20:36
[mpi] MAGETWO-72551: Update version in composer to 2.2.1-dev for 2.2-develop branch
expectException(); expectExceptionMessage()
expectException(); expectExceptionMessage()
@orlangur orlangur self-assigned this Sep 26, 2017
@vrann vrann self-assigned this Sep 26, 2017
@vrann vrann added this to the September 2017 milestone Sep 26, 2017
@orlangur orlangur removed their assignment Sep 27, 2017
@vrann
Copy link
Contributor

vrann commented Sep 27, 2017

@schmengler there were couple problems in the tests:

  • Magento\Test\Bootstrap\SettingsTest::testGetAsConfigFileException with data set "non-existing setting" ('non_existing', Magento\Framework\Phrase Object (...)) PHPUnit\Framework\Exception: Argument #1 (No Value) of PHPUnit\Framework\TestCase::expectExceptionMessage() must be a string
  • Magento\Test\Bootstrap\SettingsTest::testGetAsConfigFileException with data set "non-existing file" ('item_label', Magento\Framework\Phrase Object (...)) PHPUnit\Framework\Exception: Argument #1 (No Value) of PHPUnit\Framework\TestCase::expectExceptionMessage() must be a string
  • Magento\Catalog\Api\ProductCustomOptionRepositoryTest::testUpdateNegative with data set "missed_product_sku" (array('title', 'field', 1, 1, 10.0, 'fixed', 'sku1', 10), 'ProductSku should be specified') Failed asserting that exception message '{"message":"Requested product doesn't exist"}' contains 'ProductSku should be specified'.

is that something you can fix? If yes, can you re-create PR with the latest 2.2-develop?

@schmengler
Copy link
Contributor Author

recreated the PR, will see that I can fix the errors

@schmengler schmengler closed this Sep 27, 2017
@vrann
Copy link
Contributor

vrann commented Sep 27, 2017

@schmengler thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants