File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
app/code/Magento/Catalog/Test/Unit/Model/ProductLink Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -298,4 +298,16 @@ public function testDeleteWithNoSuchEntityException()
298298
299299 $ this ->model ->delete ($ entityMock );
300300 }
301+
302+ public function testSaveWithNullLinkedProductSku ()
303+ {
304+ $ this ->expectException ('Magento\Framework\Exception\CouldNotSaveException ' );
305+ $ this ->expectExceptionMessage ('The linked product SKU is invalid. Verify the data and try again. ' );
306+
307+ $ entityMock = $ this ->createMock (\Magento \Catalog \Model \ProductLink \Link::class);
308+ $ entityMock ->expects ($ this ->any ())->method ('getSku ' )->willReturn ('sku1 ' );
309+ $ entityMock ->expects ($ this ->any ())->method ('getLinkedProductSku ' )->willReturn (null );
310+
311+ $ this ->model ->save ($ entityMock );
312+ }
301313}
You can’t perform that action at this time.
0 commit comments