Skip to content

Fixing a test for Magento Newsletter. #19365

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 1 commit into from
Nov 26, 2018
Merged

Fixing a test for Magento Newsletter. #19365

merged 1 commit into from
Nov 26, 2018

Conversation

tiagosampaio
Copy link
Member

@tiagosampaio tiagosampaio commented Nov 23, 2018

Fixing a test for Magento Newsletter.

Description

The problem occurred because the constructor is being considered. By running the phpunit directly you can check this error out.

> php ./vendor/bin/phpunit -c ./dev/tests/unit/phpunit.xml.dist ./app/code/Magento/Newsletter

The tests will break.

1) Magento\Newsletter\Test\Unit\Model\ProblemTest::testAddSubscriberData
ArgumentCountError: Too few arguments to function Magento\Newsletter\Model\SubscriberFactory::__construct(), 0 passed in /Users/tiagosampaio/Sites/OpenSource/Magento2/vendor/phpunit/phpunit-mock-objects/src/Generator.php on line 216 and at least 1 expected

/Users/tiagosampaio/Sites/OpenSource/Magento2/generated/code/Magento/Newsletter/Model/SubscriberFactory.php:29
/Users/tiagosampaio/Sites/OpenSource/Magento2/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php:71

2) Magento\Newsletter\Test\Unit\Model\ProblemTest::testAddQueueData
ArgumentCountError: Too few arguments to function Magento\Newsletter\Model\SubscriberFactory::__construct(), 0 passed in /Users/tiagosampaio/Sites/OpenSource/Magento2/vendor/phpunit/phpunit-mock-objects/src/Generator.php on line 216 and at least 1 expected

/Users/tiagosampaio/Sites/OpenSource/Magento2/generated/code/Magento/Newsletter/Model/SubscriberFactory.php:29
/Users/tiagosampaio/Sites/OpenSource/Magento2/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php:71

3) Magento\Newsletter\Test\Unit\Model\ProblemTest::testAddErrorData
ArgumentCountError: Too few arguments to function Magento\Newsletter\Model\SubscriberFactory::__construct(), 0 passed in /Users/tiagosampaio/Sites/OpenSource/Magento2/vendor/phpunit/phpunit-mock-objects/src/Generator.php on line 216 and at least 1 expected

/Users/tiagosampaio/Sites/OpenSource/Magento2/generated/code/Magento/Newsletter/Model/SubscriberFactory.php:29
/Users/tiagosampaio/Sites/OpenSource/Magento2/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php:71

4) Magento\Newsletter\Test\Unit\Model\ProblemTest::testGetSubscriberWithNoSubscriberId
ArgumentCountError: Too few arguments to function Magento\Newsletter\Model\SubscriberFactory::__construct(), 0 passed in /Users/tiagosampaio/Sites/OpenSource/Magento2/vendor/phpunit/phpunit-mock-objects/src/Generator.php on line 216 and at least 1 expected

/Users/tiagosampaio/Sites/OpenSource/Magento2/generated/code/Magento/Newsletter/Model/SubscriberFactory.php:29
/Users/tiagosampaio/Sites/OpenSource/Magento2/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php:71

5) Magento\Newsletter\Test\Unit\Model\ProblemTest::testGetSubscriber
ArgumentCountError: Too few arguments to function Magento\Newsletter\Model\SubscriberFactory::__construct(), 0 passed in /Users/tiagosampaio/Sites/OpenSource/Magento2/vendor/phpunit/phpunit-mock-objects/src/Generator.php on line 216 and at least 1 expected

/Users/tiagosampaio/Sites/OpenSource/Magento2/generated/code/Magento/Newsletter/Model/SubscriberFactory.php:29
/Users/tiagosampaio/Sites/OpenSource/Magento2/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php:71

6) Magento\Newsletter\Test\Unit\Model\ProblemTest::testUnsubscribeWithNoSubscriber
ArgumentCountError: Too few arguments to function Magento\Newsletter\Model\SubscriberFactory::__construct(), 0 passed in /Users/tiagosampaio/Sites/OpenSource/Magento2/vendor/phpunit/phpunit-mock-objects/src/Generator.php on line 216 and at least 1 expected

/Users/tiagosampaio/Sites/OpenSource/Magento2/generated/code/Magento/Newsletter/Model/SubscriberFactory.php:29
/Users/tiagosampaio/Sites/OpenSource/Magento2/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php:71

7) Magento\Newsletter\Test\Unit\Model\ProblemTest::testUnsubscribe
ArgumentCountError: Too few arguments to function Magento\Newsletter\Model\SubscriberFactory::__construct(), 0 passed in /Users/tiagosampaio/Sites/OpenSource/Magento2/vendor/phpunit/phpunit-mock-objects/src/Generator.php on line 216 and at least 1 expected

/Users/tiagosampaio/Sites/OpenSource/Magento2/generated/code/Magento/Newsletter/Model/SubscriberFactory.php:29
/Users/tiagosampaio/Sites/OpenSource/Magento2/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php:71

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)

@magento-engcom-team
Copy link
Contributor

Hi @tiagosampaio. 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-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.2-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

Copy link
Member

@rodrigowebjump rodrigowebjump left a comment

Choose a reason for hiding this comment

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

Hi @tiagosampaio Thanks for your contribution

@magento-engcom-team
Copy link
Contributor

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

@tiagosampaio
Copy link
Member Author

Hi @rodrigowebjump. Thank you for your review.

@nuzil nuzil self-requested a review November 25, 2018 07:17
@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

Hi @tiagosampaio. Thank you for your contribution.
We will aim to release these changes as part of 2.2.8.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

@diazwatson
Copy link
Contributor

Hey guys, how can I move this to Port to 2.3 Created column?

@sidolov
Copy link
Contributor

sidolov commented Jan 7, 2019

Hi @diazwatson , please, create PR from your fork to the Magento repository and this port will move on the board automatically.

@diazwatson
Copy link
Contributor

diazwatson commented Jan 7, 2019

Hi @sidolov , I did it last 27 Nov, here is the link
https://github.com/diazwatson/magento2/pull/1

@tiagosampaio tiagosampaio restored the 2.2-develop-032 branch March 10, 2020 20:05
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.

6 participants