File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Test/Unit/Model/ProductLink Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -134,13 +134,13 @@ public function __construct(
134
134
public function save (\Magento \Catalog \Api \Data \ProductLinkInterface $ entity )
135
135
{
136
136
if (!$ entity ->getSku ()) {
137
- throw new NoSuchEntityException (__ (
137
+ throw new CouldNotSaveException (__ (
138
138
'The parent product SKU is required for linking child products. '
139
139
. 'Please ensure the parent product SKU is provided and try again. '
140
140
));
141
141
}
142
142
if (!$ entity ->getLinkedProductSku ()) {
143
- throw new NoSuchEntityException (__ ('The linked product SKU is invalid. Verify the data and try again. ' ));
143
+ throw new CouldNotSaveException (__ ('The linked product SKU is invalid. Verify the data and try again. ' ));
144
144
}
145
145
$ linkedProduct = $ this ->productRepository ->get ($ entity ->getLinkedProductSku ());
146
146
$ product = $ this ->productRepository ->get ($ entity ->getSku ());
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ public function testSaveWithoutLinkedProductSku()
192
192
193
193
public function testSaveWithoutProductSku ()
194
194
{
195
- $ this ->expectException ('Magento\Framework\Exception\NoSuchEntityException ' );
195
+ $ this ->expectException ('Magento\Framework\Exception\CouldNotSaveException ' );
196
196
$ this ->expectExceptionMessage (
197
197
'The parent product SKU is required for linking child products. '
198
198
. 'Please ensure the parent product SKU is provided and try again. '
You can’t perform that action at this time.
0 commit comments