File tree Expand file tree Collapse file tree 10 files changed +31
-31
lines changed
Test/Unit/Controller/Product Expand file tree Collapse file tree 10 files changed +31
-31
lines changed Original file line number Diff line number Diff line change @@ -33,17 +33,17 @@ public function execute()
33
33
try {
34
34
$ this ->getModel ()->aggregate ()->delete ();
35
35
36
- $ this ->messageManager ->addSuccess (__ ('The review has been deleted. ' ));
36
+ $ this ->messageManager ->addSuccessMessage (__ ('The review has been deleted. ' ));
37
37
if ($ this ->getRequest ()->getParam ('ret ' ) == 'pending ' ) {
38
38
$ resultRedirect ->setPath ('review/*/pending ' );
39
39
} else {
40
40
$ resultRedirect ->setPath ('review/*/ ' );
41
41
}
42
42
return $ resultRedirect ;
43
43
} catch (\Magento \Framework \Exception \LocalizedException $ e ) {
44
- $ this ->messageManager ->addError ($ e ->getMessage ());
44
+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
45
45
} catch (\Exception $ e ) {
46
- $ this ->messageManager ->addException ($ e , __ ('Something went wrong deleting this review. ' ));
46
+ $ this ->messageManager ->addExceptionMessage ($ e , __ ('Something went wrong deleting this review. ' ));
47
47
}
48
48
49
49
return $ resultRedirect ->setPath ('review/*/edit/ ' , ['id ' => $ reviewId ]);
Original file line number Diff line number Diff line change @@ -59,19 +59,19 @@ public function execute()
59
59
{
60
60
$ reviewsIds = $ this ->getRequest ()->getParam ('reviews ' );
61
61
if (!is_array ($ reviewsIds )) {
62
- $ this ->messageManager ->addError (__ ('Please select review(s). ' ));
62
+ $ this ->messageManager ->addErrorMessage (__ ('Please select review(s). ' ));
63
63
} else {
64
64
try {
65
65
foreach ($ this ->getCollection () as $ model ) {
66
66
$ model ->delete ();
67
67
}
68
- $ this ->messageManager ->addSuccess (
68
+ $ this ->messageManager ->addSuccessMessage (
69
69
__ ('A total of %1 record(s) have been deleted. ' , count ($ reviewsIds ))
70
70
);
71
71
} catch (LocalizedException $ e ) {
72
- $ this ->messageManager ->addError ($ e ->getMessage ());
72
+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
73
73
} catch (\Exception $ e ) {
74
- $ this ->messageManager ->addException ($ e , __ ('Something went wrong while deleting these records. ' ));
74
+ $ this ->messageManager ->addExceptionMessage ($ e , __ ('Something went wrong while deleting these records. ' ));
75
75
}
76
76
}
77
77
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
Original file line number Diff line number Diff line change @@ -59,20 +59,20 @@ public function execute()
59
59
{
60
60
$ reviewsIds = $ this ->getRequest ()->getParam ('reviews ' );
61
61
if (!is_array ($ reviewsIds )) {
62
- $ this ->messageManager ->addError (__ ('Please select review(s). ' ));
62
+ $ this ->messageManager ->addErrorMessage (__ ('Please select review(s). ' ));
63
63
} else {
64
64
try {
65
65
$ status = $ this ->getRequest ()->getParam ('status ' );
66
66
foreach ($ this ->getCollection () as $ model ) {
67
67
$ model ->setStatusId ($ status )->save ()->aggregate ();
68
68
}
69
- $ this ->messageManager ->addSuccess (
69
+ $ this ->messageManager ->addSuccessMessage (
70
70
__ ('A total of %1 record(s) have been updated. ' , count ($ reviewsIds ))
71
71
);
72
72
} catch (LocalizedException $ e ) {
73
- $ this ->messageManager ->addError ($ e ->getMessage ());
73
+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
74
74
} catch (\Exception $ e ) {
75
- $ this ->messageManager ->addException (
75
+ $ this ->messageManager ->addExceptionMessage (
76
76
$ e ,
77
77
__ ('Something went wrong while updating these review(s). ' )
78
78
);
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public function execute()
18
18
{
19
19
$ reviewsIds = $ this ->getRequest ()->getParam ('reviews ' );
20
20
if (!is_array ($ reviewsIds )) {
21
- $ this ->messageManager ->addError (__ ('Please select review(s). ' ));
21
+ $ this ->messageManager ->addErrorMessage (__ ('Please select review(s). ' ));
22
22
} else {
23
23
try {
24
24
$ stores = $ this ->getRequest ()->getParam ('stores ' );
@@ -27,13 +27,13 @@ public function execute()
27
27
$ model ->setSelectStores ($ stores );
28
28
$ model ->save ();
29
29
}
30
- $ this ->messageManager ->addSuccess (
30
+ $ this ->messageManager ->addSuccessMessage (
31
31
__ ('A total of %1 record(s) have been updated. ' , count ($ reviewsIds ))
32
32
);
33
33
} catch (LocalizedException $ e ) {
34
- $ this ->messageManager ->addError ($ e ->getMessage ());
34
+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
35
35
} catch (\Exception $ e ) {
36
- $ this ->messageManager ->addException (
36
+ $ this ->messageManager ->addExceptionMessage (
37
37
$ e ,
38
38
__ ('Something went wrong while updating these review(s). ' )
39
39
);
Original file line number Diff line number Diff line change @@ -56,17 +56,17 @@ public function execute()
56
56
57
57
$ review ->aggregate ();
58
58
59
- $ this ->messageManager ->addSuccess (__ ('You saved the review. ' ));
59
+ $ this ->messageManager ->addSuccessMessage (__ ('You saved the review. ' ));
60
60
if ($ this ->getRequest ()->getParam ('ret ' ) == 'pending ' ) {
61
61
$ resultRedirect ->setPath ('review/*/pending ' );
62
62
} else {
63
63
$ resultRedirect ->setPath ('review/*/ ' );
64
64
}
65
65
return $ resultRedirect ;
66
66
} catch (LocalizedException $ e ) {
67
- $ this ->messageManager ->addError ($ e ->getMessage ());
67
+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
68
68
} catch (\Exception $ e ) {
69
- $ this ->messageManager ->addException ($ e , __ ('Something went wrong while saving this review. ' ));
69
+ $ this ->messageManager ->addExceptionMessage ($ e , __ ('Something went wrong while saving this review. ' ));
70
70
}
71
71
}
72
72
$ resultRedirect ->setPath ('review/*/ ' );
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public function execute()
34
34
if (($ data = $ this ->getRequest ()->getPostValue ()) && ($ reviewId = $ this ->getRequest ()->getParam ('id ' ))) {
35
35
$ review = $ this ->getModel ();
36
36
if (!$ review ->getId ()) {
37
- $ this ->messageManager ->addError (__ ('The review was removed by another user or does not exist. ' ));
37
+ $ this ->messageManager ->addErrorMessage (__ ('The review was removed by another user or does not exist. ' ));
38
38
} else {
39
39
try {
40
40
$ review ->addData ($ data )->save ();
@@ -63,11 +63,11 @@ public function execute()
63
63
64
64
$ review ->aggregate ();
65
65
66
- $ this ->messageManager ->addSuccess (__ ('You saved the review. ' ));
66
+ $ this ->messageManager ->addSuccessMessage (__ ('You saved the review. ' ));
67
67
} catch (LocalizedException $ e ) {
68
- $ this ->messageManager ->addError ($ e ->getMessage ());
68
+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
69
69
} catch (\Exception $ e ) {
70
- $ this ->messageManager ->addException ($ e , __ ('Something went wrong while saving this review. ' ));
70
+ $ this ->messageManager ->addExceptionMessage ($ e , __ ('Something went wrong while saving this review. ' ));
71
71
}
72
72
}
73
73
Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ public function execute()
23
23
/** @var \Magento\Review\Model\Rating $model */
24
24
$ model = $ this ->_objectManager ->create (\Magento \Review \Model \Rating::class);
25
25
$ model ->load ($ this ->getRequest ()->getParam ('id ' ))->delete ();
26
- $ this ->messageManager ->addSuccess (__ ('You deleted the rating. ' ));
26
+ $ this ->messageManager ->addSuccessMessage (__ ('You deleted the rating. ' ));
27
27
} catch (\Exception $ e ) {
28
- $ this ->messageManager ->addError ($ e ->getMessage ());
28
+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
29
29
$ resultRedirect ->setPath ('review/rating/edit ' , ['id ' => $ this ->getRequest ()->getParam ('id ' )]);
30
30
return $ resultRedirect ;
31
31
}
Original file line number Diff line number Diff line change @@ -58,10 +58,10 @@ public function execute()
58
58
}
59
59
}
60
60
61
- $ this ->messageManager ->addSuccess (__ ('You saved the rating. ' ));
61
+ $ this ->messageManager ->addSuccessMessage (__ ('You saved the rating. ' ));
62
62
$ this ->_objectManager ->get (\Magento \Backend \Model \Session::class)->setRatingData (false );
63
63
} catch (\Exception $ e ) {
64
- $ this ->messageManager ->addError ($ e ->getMessage ());
64
+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
65
65
$ this ->_objectManager ->get (\Magento \Backend \Model \Session::class)
66
66
->setRatingData ($ this ->getRequest ()->getPostValue ());
67
67
$ resultRedirect ->setPath ('review/rating/edit ' , ['id ' => $ this ->getRequest ()->getParam ('id ' )]);
Original file line number Diff line number Diff line change @@ -63,19 +63,19 @@ public function execute()
63
63
}
64
64
65
65
$ review ->aggregate ();
66
- $ this ->messageManager ->addSuccess (__ ('You submitted your review for moderation. ' ));
66
+ $ this ->messageManager ->addSuccessMessage (__ ('You submitted your review for moderation. ' ));
67
67
} catch (\Exception $ e ) {
68
68
$ this ->reviewSession ->setFormData ($ data );
69
- $ this ->messageManager ->addError (__ ('We can \'t post your review right now. ' ));
69
+ $ this ->messageManager ->addErrorMessage (__ ('We can \'t post your review right now. ' ));
70
70
}
71
71
} else {
72
72
$ this ->reviewSession ->setFormData ($ data );
73
73
if (is_array ($ validate )) {
74
74
foreach ($ validate as $ errorMessage ) {
75
- $ this ->messageManager ->addError ($ errorMessage );
75
+ $ this ->messageManager ->addErrorMessage ($ errorMessage );
76
76
}
77
77
} else {
78
- $ this ->messageManager ->addError (__ ('We can \'t post your review right now. ' ));
78
+ $ this ->messageManager ->addErrorMessage (__ ('We can \'t post your review right now. ' ));
79
79
}
80
80
}
81
81
}
Original file line number Diff line number Diff line change @@ -299,7 +299,7 @@ public function testExecute()
299
299
->willReturnSelf ();
300
300
$ this ->review ->expects ($ this ->once ())->method ('aggregate ' )
301
301
->willReturnSelf ();
302
- $ this ->messageManager ->expects ($ this ->once ())->method ('addSuccess ' )
302
+ $ this ->messageManager ->expects ($ this ->once ())->method ('addSuccessMessage ' )
303
303
->with (__ ('You submitted your review for moderation. ' ))
304
304
->willReturnSelf ();
305
305
$ this ->reviewSession ->expects ($ this ->once ())->method ('getRedirectUrl ' )
You can’t perform that action at this time.
0 commit comments