File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
app/code/Magento/Checkout/Test/Unit/Controller/Cart Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ class AddTest extends \PHPUnit\Framework\TestCase
3434 */
3535 private $ messageManager ;
3636
37+ /**
38+ * @var \Magento\Checkout\Controller\Cart\Add | \PHPUnit_Framework_MockObject_MockObject
39+ */
40+ private $ cartAdd ;
41+
3742 /**
3843 * Init mocks for tests.
3944 *
@@ -52,7 +57,7 @@ public function setUp()
5257 ->disableOriginalConstructor ()->getMock ();
5358
5459 $ this ->objectManagerHelper = new ObjectManagerHelper ($ this );
55- $ this ->add = $ this ->objectManagerHelper ->getObject (
60+ $ this ->cartAdd = $ this ->objectManagerHelper ->getObject (
5661 \Magento \Checkout \Controller \Cart \Add::class,
5762 [
5863 '_formKeyValidator ' => $ this ->formKeyValidator ,
@@ -79,6 +84,6 @@ public function testExecute()
7984 $ this ->messageManager ->expects ($ this ->once ())->method ('addErrorMessage ' );
8085 $ this ->resultRedirectFactory ->expects ($ this ->once ())->method ('create ' )->willReturn ($ redirect );
8186 $ redirect ->expects ($ this ->once ())->method ('setPath ' )->with ($ path )->willReturnSelf ();
82- $ this ->assertEquals ($ redirect , $ this ->add ->execute ());
87+ $ this ->assertEquals ($ redirect , $ this ->cartAdd ->execute ());
8388 }
8489}
You can’t perform that action at this time.
0 commit comments