Added $websiteString property to test class#142
Added $websiteString property to test class#142magento-engcom-team merged 2 commits intomagento-engcom:2.3-developfrom maxalmonte14:improvement/supress_undefined_websiteString_property_error
Conversation
|
Hello, thank you for your pull request. I will start to process this PR and get back to you if I need any more information. |
| /** | ||
| * @var \Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator\Website|\PHPUnit_Framework_MockObject_MockObject | ||
| */ | ||
| protected $websiteString; |
There was a problem hiding this comment.
After looking into the usage of this it seems to only be used in one method. I would suggest in this case we convert it to a local variable to the function. Something like:
$websiteString = $this->getMockBuilder(
\Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator\Website::class
)
->setMethods(['_clearMessages', '_addMessages'])
->setConstructorArgs([$this->storeResolver, $this->webSiteModel])
->getMock();
$result = $websiteString->getAllWebsitesValue();
After making this change please also run the unit test to make sure it is not failing. This can be done via the command:
./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php
|
I extracted the |
Description (*)
This PR solves the problem addressed in #132
Fixed Issues (if relevant)
Clean up app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php
Manual testing scenarios (*)
./vendor/bin/phpstan analyse app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.phpas described in Clean up app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php #132, after this implementation the following error shouldn't be presentContribution checklist (*)