Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class WebsiteTest extends \PHPUnit\Framework\TestCase
*/
protected $website;

/**
* @var \Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator\Website|\PHPUnit_Framework_MockObject_MockObject
*/
protected $websiteString;
Copy link
Contributor

Choose a reason for hiding this comment

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

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


protected function setUp()
{
$this->webSiteModel = $this->getMockBuilder(\Magento\Store\Model\Website::class)
Expand Down