Skip to content

Commit 293c7d9

Browse files
Replaced deprecated function addError
1 parent c8e347f commit 293c7d9

File tree

44 files changed

+95
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+95
-95
lines changed

app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ protected function addInvalidMessage($customerAddress)
280280
$message[] = (string)__('You will be charged tax.');
281281
}
282282

283-
$this->messageManager->addError(implode(' ', $message));
283+
$this->messageManager->addErrorMessage(implode(' ', $message));
284284

285285
return $this;
286286
}
@@ -307,7 +307,7 @@ protected function addErrorMessage($customerAddress)
307307
$email = $this->scopeConfig->getValue('trans_email/ident_support/email', ScopeInterface::SCOPE_STORE);
308308
$message[] = (string)__('If you believe this is an error, please contact us at %1', $email);
309309

310-
$this->messageManager->addError(implode(' ', $message));
310+
$this->messageManager->addErrorMessage(implode(' ', $message));
311311

312312
return $this;
313313
}

app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ public function testAfterAddressSaveNewGroup(
595595
->with($vatId)
596596
->willReturn($vatId);
597597
$this->messageManager->expects($this->once())
598-
->method('addError')
598+
->method('addErrorMessage')
599599
->with($resultInvalidMessage)
600600
->willReturnSelf();
601601
}
@@ -605,7 +605,7 @@ public function testAfterAddressSaveNewGroup(
605605
->with('trans_email/ident_support/email', ScopeInterface::SCOPE_STORE)
606606
->willReturn('admin@example.com');
607607
$this->messageManager->expects($this->once())
608-
->method('addError')
608+
->method('addErrorMessage')
609609
->with($resultErrorMessage)
610610
->willReturnSelf();
611611
}

app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/Product/Edit/Link.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function execute()
125125
try {
126126
$this->_processDownload($resource, $resourceType);
127127
} catch (\Magento\Framework\Exception\LocalizedException $e) {
128-
$this->messageManager->addError(__('Something went wrong while getting the requested content.'));
128+
$this->messageManager->addErrorMessage(__('Something went wrong while getting the requested content.'));
129129
}
130130
}
131131
}

app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/Product/Edit/Sample.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function execute()
5454
try {
5555
$this->_processDownload($resource, $resourceType);
5656
} catch (\Magento\Framework\Exception\LocalizedException $e) {
57-
$this->messageManager->addError(__('Something went wrong while getting the requested content.'));
57+
$this->messageManager->addErrorMessage(__('Something went wrong while getting the requested content.'));
5858
}
5959
}
6060
}

app/code/Magento/Downloadable/Controller/Download/Link.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ public function execute()
125125
// phpcs:ignore Magento2.Security.LanguageConstruct.ExitUsage
126126
exit(0);
127127
} catch (\Exception $e) {
128-
$this->messageManager->addError(__('Something went wrong while getting the requested content.'));
128+
$this->messageManager->addErrorMessage(__('Something went wrong while getting the requested content.'));
129129
}
130130
} elseif ($status == PurchasedLink::LINK_STATUS_EXPIRED) {
131131
$this->messageManager->addNotice(__('The link has expired.'));
132132
} elseif ($status == PurchasedLink::LINK_STATUS_PENDING || $status == PurchasedLink::LINK_STATUS_PAYMENT_REVIEW
133133
) {
134134
$this->messageManager->addNotice(__('The link is not available.'));
135135
} else {
136-
$this->messageManager->addError(__('Something went wrong while getting the requested content.'));
136+
$this->messageManager->addErrorMessage(__('Something went wrong while getting the requested content.'));
137137
}
138138
return $this->_redirect('*/customer/products');
139139
}

app/code/Magento/Downloadable/Controller/Download/LinkSample.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function execute()
6666
// phpcs:ignore Magento2.Security.LanguageConstruct.ExitUsage
6767
exit(0);
6868
} catch (\Exception $e) {
69-
$this->messageManager->addError(
69+
$this->messageManager->addErrorMessage(
7070
__('Sorry, there was an error getting requested content. Please contact the store owner.')
7171
);
7272
}

app/code/Magento/Downloadable/Controller/Download/Sample.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function execute()
6363
// phpcs:ignore Magento2.Security.LanguageConstruct.ExitUsage
6464
exit(0);
6565
} catch (\Exception $e) {
66-
$this->messageManager->addError(
66+
$this->messageManager->addErrorMessage(
6767
__('Sorry, there was an error getting requested content. Please contact the store owner.')
6868
);
6969
}

app/code/Magento/Downloadable/Test/Unit/Controller/Download/LinkSampleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public function testExecuteLinkTypeUrl()
173173
$this->response->expects($this->any())->method('setHeader')->willReturnSelf();
174174
$this->downloadHelper->expects($this->once())->method('output')->willThrowException(new \Exception());
175175
$this->messageManager->expects($this->once())
176-
->method('addError')
176+
->method('addErrorMessage')
177177
->with('Sorry, there was an error getting requested content. Please contact the store owner.')
178178
->willReturnSelf();
179179
$this->redirect->expects($this->once())->method('getRedirectUrl')->willReturn('redirect_url');
@@ -226,7 +226,7 @@ public function testExecuteLinkTypeFile()
226226
$this->response->expects($this->any())->method('setHeader')->willReturnSelf();
227227
$this->downloadHelper->expects($this->once())->method('output')->willThrowException(new \Exception());
228228
$this->messageManager->expects($this->once())
229-
->method('addError')
229+
->method('addErrorMessage')
230230
->with('Sorry, there was an error getting requested content. Please contact the store owner.')
231231
->willReturnSelf();
232232
$this->redirect->expects($this->once())->method('getRedirectUrl')->willReturn('redirect_url');

app/code/Magento/Downloadable/Test/Unit/Controller/Download/LinkTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public function testExceptionInUpdateLinkStatus($mimeType, $disposition)
327327
$this->linkPurchasedItem->expects($this->any())->method('setStatus')->with('expired')->willReturnSelf();
328328
$this->linkPurchasedItem->expects($this->any())->method('save')->willThrowException(new \Exception());
329329
$this->messageManager->expects($this->once())
330-
->method('addError')
330+
->method('addErrorMessage')
331331
->with('Something went wrong while getting the requested content.')
332332
->willReturnSelf();
333333
$this->redirect->expects($this->once())->method('redirect')->with($this->response, '*/customer/products', []);
@@ -494,7 +494,7 @@ public function linkNotAvailableDataProvider()
494494
['addNotice', 'expired', 'The link has expired.'],
495495
['addNotice', 'pending', 'The link is not available.'],
496496
['addNotice', 'payment_review', 'The link is not available.'],
497-
['addError', 'wrong_status', 'Something went wrong while getting the requested content.']
497+
['addErrorMessage', 'wrong_status', 'Something went wrong while getting the requested content.']
498498
];
499499
}
500500

app/code/Magento/Downloadable/Test/Unit/Controller/Download/SampleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public function testExecuteSampleWithUrlType()
172172
$this->response->expects($this->any())->method('setHeader')->willReturnSelf();
173173
$this->downloadHelper->expects($this->once())->method('output')->willThrowException(new \Exception());
174174
$this->messageManager->expects($this->once())
175-
->method('addError')
175+
->method('addErrorMessage')
176176
->with('Sorry, there was an error getting requested content. Please contact the store owner.')
177177
->willReturnSelf();
178178
$this->redirect->expects($this->once())->method('getRedirectUrl')->willReturn('redirect_url');
@@ -221,7 +221,7 @@ public function testExecuteSampleWithFileType()
221221
$this->response->expects($this->any())->method('setHeader')->willReturnSelf();
222222
$this->downloadHelper->expects($this->once())->method('output')->willThrowException(new \Exception());
223223
$this->messageManager->expects($this->once())
224-
->method('addError')
224+
->method('addErrorMessage')
225225
->with('Sorry, there was an error getting requested content. Please contact the store owner.')
226226
->willReturnSelf();
227227
$this->redirect->expects($this->once())->method('getRedirectUrl')->willReturn('redirect_url');

0 commit comments

Comments
 (0)