Skip to content
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

Removed usage of AspectMock in AnnotationsCheckTest.php #834

Merged
merged 1 commit into from
Jun 28, 2021

Conversation

drpayyne
Copy link
Contributor

@drpayyne drpayyne commented Jun 20, 2021

Description

Removed usage of AspectMock in \tests\unit\Magento\FunctionalTestFramework\StaticCheck\AnnotationsCheckTest

Fixed Issues (if relevant)

  1. [MFTF] Replace AspectMock with PHPUnit for AnnotationsCheckTest magento2#33288: [MFTF] Replace AspectMock with PHPUnit for AnnotationsCheckTest

Resolves magento/magento2#33288

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/verification tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)
  • Changes to Framework doesn't have backward incompatible changes for tests or have related Pull Request with fixes to tests

@magento-engcom-team magento-engcom-team added Partner: EY partners-contribution Pull Request is created by Magento Partner labels Jun 20, 2021
@jilu1
Copy link
Contributor

jilu1 commented Jun 21, 2021

@drpayyne
Thank you for your PR!

Same here. Please ignore the Error: Resource not accessible by integration for now.

@jilu1
Copy link
Contributor

jilu1 commented Jun 23, 2021

@magento-engcom-team
Copy link

@jilu1 the pull request successfully imported.

)->make();
$test = $this->createMock(TestObject::class);

$test->expects($this->once())->method('getAnnotations')->willReturn($annotations);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add $test->expects($this->once())->method('getName')->willReturn('AnnotationsCheckTest');?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind. Actually getName() is not invoked in this test case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I added that expectation with a once and the test failed, that's why I removed it. :)

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.

[MFTF] Replace AspectMock with PHPUnit for AnnotationsCheckTest
4 participants