Skip to content

ISSUE-27500: Fixed unit tests for module Magento_SampleData #27598

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
merged 3 commits into from
Apr 17, 2020

Conversation

andrewbess
Copy link
Contributor

Description (*)

This PR partially updates unit tests in SampleData module
Other tests of this module have been updated in #27481

Related Pull Requests

Fixed Issues (if relevant)

  1. Unit Tests incompatible with PHPUnit 8 #27500: Unit Tests incompatible with PHPUnit 8

Manual testing scenarios (*)

  1. Run tests in phpunit 6 (currently in 2.4-develop) using vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/Magento/SampleData/
  2. Install phpunit 8, run tests using vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/Magento/SampleData/

Questions or comments

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 are green)

@m2-assistant
Copy link

m2-assistant bot commented Apr 4, 2020

Hi @andrewbess. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

Copy link
Contributor

@lbajsarowicz lbajsarowicz left a comment

Choose a reason for hiding this comment

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

Please review the comments. Only minor changes to be introduced.

@@ -197,11 +210,11 @@ public function stubComposerJsonReader(array $composerJsonContent)
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject
* @return MockObject
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @return MockObject
* @return ReadInterface|MockObject

@@ -178,11 +190,12 @@ public static function dataPackagesFromComposerSuggest()

/**
* @param array $composerJsonContent
* @return \PHPUnit_Framework_MockObject_MockObject
* @return MockObject
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @return MockObject
* @return ReadInterface|MockObject

Comment on lines 195 to 197
public function stubComposerJsonReader(
array $composerJsonContent
): MockObject {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public function stubComposerJsonReader(
array $composerJsonContent
): MockObject {
public function stubComposerJsonReader(array $composerJsonContent): MockObject {

@magento-engcom-team
Copy link
Contributor

Hi @lbajsarowicz, thank you for the review.
ENGCOM-7263 has been created to process this Pull Request
✳️ @lbajsarowicz, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@dmytro-ch dmytro-ch added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Apr 5, 2020
lbajsarowicz
lbajsarowicz previously approved these changes Apr 5, 2020
Copy link
Contributor

@lbajsarowicz lbajsarowicz left a comment

Choose a reason for hiding this comment

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

✔️ Great job, thank you for your contribution.

@magento-engcom-team
Copy link
Contributor

Hi @lbajsarowicz, thank you for the review.
ENGCOM-7263 has been created to process this Pull Request

Copy link
Contributor

@engcom-Alfa engcom-Alfa left a comment

Choose a reason for hiding this comment

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

Hi @andrewbess

During testing, we faced the issue

PHPUnit 8

Run: vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/Magento/SampleData/

Actual Result:
Screenshot from 2020-04-09 12-20-54

@andrewbess Could you take a look?
Thanks!

@ghost ghost dismissed lbajsarowicz’s stale review April 9, 2020 09:24

Pull Request state was updated. Re-review required.

@andrewbess
Copy link
Contributor Author

andrewbess commented Apr 15, 2020

Hello @engcom-Alfa
It has already done earlier in #27481 but still doesn't merged.

@slavvka slavvka changed the base branch from 2.4-develop to phpunit8 April 16, 2020 14:48
@slavvka
Copy link
Member

slavvka commented Apr 16, 2020

@andrewbess Please resolve the conflict

…ps://github.com/andrewbess/magento2 into ISSUE-27500/Magento_SampleData

� Conflicts:
�	app/code/Magento/SampleData/Test/Unit/Model/DependencyTest.php
@andrewbess
Copy link
Contributor Author

Hello @slavvka
Done.
Please check.
Thank you in advance.

Copy link
Contributor

@lbajsarowicz lbajsarowicz left a comment

Choose a reason for hiding this comment

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

Looks fine for me.

@ghost ghost assigned slavvka Apr 17, 2020
@slavvka slavvka merged commit b93e9c4 into magento:phpunit8 Apr 17, 2020
@m2-assistant
Copy link

m2-assistant bot commented Apr 17, 2020

Hi @andrewbess, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: SampleData Event: Global-Contribution-Day Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants