File tree Expand file tree Collapse file tree 3 files changed +5
-9
lines changed
app/code/Magento/Wishlist/Test
dev/tests/integration/testsuite/Magento/Wishlist/Controller/Index Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 19
19
<click selector =" {{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(product.name)}}" stepKey =" AddProductToCartFromWishlistUsingSidebarClickAddToCartFromWishlist" />
20
20
<waitForElement selector =" {{StorefrontCategoryMainSection.SuccessMsg}}" time =" 30" stepKey =" AddProductToCartFromWishlistUsingSidebarWaitForSuccessMessage" />
21
21
<see selector =" {{StorefrontCategoryMainSection.SuccessMsg}}" userInput =" You added {{product.name}} to your shopping cart." stepKey =" AddProductToCartFromWishlistUsingSidebarSeeProductNameAddedToCartFromWishlist" />
22
+ <seeLink userInput =" shopping cart" stepKey =" seeLinkInSuccessMsg" />
22
23
</actionGroup >
23
24
</actionGroups >
Original file line number Diff line number Diff line change 10
10
use Magento \Catalog \Helper \Product as ProductHelper ;
11
11
use Magento \Catalog \Model \Product ;
12
12
use Magento \Catalog \Model \Product \Exception as ProductException ;
13
- use Magento \Checkout \Model \Cart as CheckoutCart ;
14
13
use Magento \Checkout \Helper \Cart as CartHelper ;
14
+ use Magento \Checkout \Model \Cart as CheckoutCart ;
15
15
use Magento \Framework \App \Action \Context ;
16
16
use Magento \Framework \App \RequestInterface ;
17
17
use Magento \Framework \App \Response \RedirectInterface ;
@@ -620,14 +620,8 @@ protected function prepareExecuteWithQuantityArray($isAjax = false)
620
620
->method ('getName ' )
621
621
->willReturn ($ productName );
622
622
623
- $ this ->escaperMock ->expects ($ this ->once ())
624
- ->method ('escapeHtml ' )
625
- ->with ($ productName , null )
626
- ->willReturn ($ productName );
627
-
628
623
$ this ->messageManagerMock ->expects ($ this ->once ())
629
- ->method ('addSuccessMessage ' )
630
- ->with ('You added ' . $ productName . ' to your shopping cart. ' , null )
624
+ ->method ('addComplexSuccessMessage ' )
631
625
->willReturnSelf ();
632
626
633
627
$ this ->cartHelperMock ->expects ($ this ->once ())
Original file line number Diff line number Diff line change @@ -69,7 +69,8 @@ public function testAddSimpleProductToCart(): void
69
69
$ item = $ this ->getWishlistByCustomerId ->getItemBySku (1 , 'simple-1 ' );
70
70
$ this ->assertNotNull ($ item );
71
71
$ this ->performAddToCartRequest (['item ' => $ item ->getId (), 'qty ' => 3 ]);
72
- $ message = sprintf ('You added %s to your shopping cart. ' , $ item ->getName ());
72
+ $ message = sprintf ("\n" . 'You added %s to your ' .
73
+ '<a href="http://localhost/index.php/checkout/cart/">shopping cart</a>. ' , $ item ->getName ());
73
74
$ this ->assertSessionMessages ($ this ->equalTo ([(string )__ ($ message )]), MessageInterface::TYPE_SUCCESS );
74
75
$ this ->assertCount (0 , $ this ->getWishlistByCustomerId ->execute (1 )->getItemCollection ());
75
76
$ cart = $ this ->cartFactory ->create ();
You can’t perform that action at this time.
0 commit comments