Skip to content

Commit 9f77a81

Browse files
committed
Add use of NoSuchEntityException exception class with namespace in test code.
1 parent dc460c8 commit 9f77a81

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

app/code/Magento/Quote/Test/Unit/Model/QuoteManagementTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Magento\Customer\Api\Data\CustomerInterface;
1111
use Magento\Customer\Model\Customer;
1212
use Magento\Framework\App\RequestInterface;
13-
use Magento\Framework\Exception\NoSuchEntityException;
1413

1514
use Magento\Framework\HTTP\PhpEnvironment\RemoteAddress;
1615
use Magento\Quote\Model\CustomerManagement;
@@ -315,7 +314,7 @@ public function testCreateEmptyCartForCustomer()
315314
->expects($this->once())
316315
->method('getActiveForCustomer')
317316
->with($userId)
318-
->willThrowException(new NoSuchEntityException());
317+
->willThrowException(new \Magento\Framework\Exception\NoSuchEntityException());
319318
$customer = $this->getMockBuilder(CustomerInterface::class)
320319
->setMethods(['getDefaultBilling'])->disableOriginalConstructor()->getMockForAbstractClass();
321320
$quoteAddress = $this->createPartialMock(
@@ -466,7 +465,7 @@ public function testAssignCustomerToNonanonymousCart()
466465
}
467466

468467
/**
469-
* @expectedException NoSuchEntityException
468+
* @expectedException \Magento\Framework\Exception\NoSuchEntityException
470469
*/
471470
public function testAssignCustomerNoSuchCustomer()
472471
{
@@ -489,7 +488,7 @@ public function testAssignCustomerNoSuchCustomer()
489488
->expects($this->once())
490489
->method('getById')
491490
->with($customerId)
492-
->willThrowException(new NoSuchEntityException());
491+
->willThrowException(new \Magento\Framework\Exception\NoSuchEntityException());
493492

494493
$this->expectExceptionMessage(
495494
"No such entity."
@@ -545,7 +544,7 @@ public function testAssignCustomer()
545544
->expects($this->once())
546545
->method('getForCustomer')
547546
->with($customerId)
548-
->willThrowException(new NoSuchEntityException());
547+
->willThrowException(new \Magento\Framework\Exception\NoSuchEntityException());
549548

550549
$activeQuoteMock = $this->createPartialMock(
551550
Quote::class,
@@ -1001,7 +1000,7 @@ protected function prepareOrderFactory(
10011000
}
10021001

10031002
/**
1004-
* @throws NoSuchEntityException
1003+
* @throws \Magento\Framework\Exception\NoSuchEntityException
10051004
*/
10061005
public function testGetCartForCustomer()
10071006
{

0 commit comments

Comments
 (0)