-
Notifications
You must be signed in to change notification settings - Fork 132
33294 eliminate aspectmock from allureHelperTest #839
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
Merged
magento-devops-reposync-svc
merged 8 commits into
magento:develop
from
SilinMykola:33294-eliminate-aspectmock-from-allure-helpertest
Aug 11, 2021
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9484d85
33294 eliminate aspectMock from allureHelperTest
1a71fe7
33294: Eliminated aspect mock from AllureHelperTest
bohdan-harniuk 4bcfac1
33294: Code refactoring after code review
bohdan-harniuk 3bf3648
33294: Code refactoring after code review
bohdan-harniuk b0e9c2e
33294: Eliminated singleton usage
bohdan-harniuk f9da313
Merge branch 'develop' of github.com:magento/magento2-functional-test…
bohdan-harniuk d920627
MFTF-33294: Fixed strict type issue
bohdan-harniuk 0641788
Merge branch 'develop' of github.com:magento/magento2-functional-test…
bohdan-harniuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This alternative way to instantiate an object of this class is only used for unit tests. This should not be used in MFTF. Am I understand it correctly here? If this is the case, can you make it clear in docblock?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jilu1, thank you for the suggestions. I've fixed it.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bohdan-harniuk
Even with clear php doc, it's still confusing to add this static method in this class. Is there any other way?
The particular test is valuable, if this cannot be mocked by PHPUnit, can we turn this into a functional test https://github.com/magento/magento2-functional-testing-framework/tree/develop/dev/tests/functional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
copyFile()
is the reason that prevents you from mocking the class, you could do something like:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @jilu1 !
It is a great approach for the copyFile method! I will use it for the testAddAttachmentUniqueName testing method!
For other tested methods we have to mock AddUniqueAttachmentEvent with the singleton approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @jilu1!
I've done that.
Thank you for your suggestion!