diff --git a/app/code/Magento/Checkout/Test/Unit/Controller/Cart/AddTest.php b/app/code/Magento/Checkout/Test/Unit/Controller/Cart/AddTest.php index a9c9ecd23d97b..9fcfdf438f8ea 100644 --- a/app/code/Magento/Checkout/Test/Unit/Controller/Cart/AddTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Controller/Cart/AddTest.php @@ -34,6 +34,11 @@ class AddTest extends \PHPUnit\Framework\TestCase */ private $messageManager; + /** + * @var \Magento\Checkout\Controller\Cart\Add | \PHPUnit_Framework_MockObject_MockObject + */ + private $cartAdd; + /** * Init mocks for tests. * @@ -52,7 +57,7 @@ public function setUp() ->disableOriginalConstructor()->getMock(); $this->objectManagerHelper = new ObjectManagerHelper($this); - $this->add = $this->objectManagerHelper->getObject( + $this->cartAdd = $this->objectManagerHelper->getObject( \Magento\Checkout\Controller\Cart\Add::class, [ '_formKeyValidator' => $this->formKeyValidator, @@ -79,6 +84,6 @@ public function testExecute() $this->messageManager->expects($this->once())->method('addErrorMessage'); $this->resultRedirectFactory->expects($this->once())->method('create')->willReturn($redirect); $redirect->expects($this->once())->method('setPath')->with($path)->willReturnSelf(); - $this->assertEquals($redirect, $this->add->execute()); + $this->assertEquals($redirect, $this->cartAdd->execute()); } }