Skip to content

Commit e622a54

Browse files
author
Serhiy Shkolyarenko
committed
MAGETWO-32501: Implement Cart Service interfaces
updated test
1 parent 2731cf6 commit e622a54

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

dev/tests/unit/testsuite/Magento/Quote/Model/QuoteManagementTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,11 @@ public function testCreateEmptyCartLoggedInUser()
199199
->with($userId)
200200
->willReturn($customerMock);
201201

202-
$this->quoteRepositoryMock->expects($this->once())->method('getActiveForCustomer')->with($userId);
202+
$this->quoteRepositoryMock
203+
->expects($this->once())
204+
->method('getActiveForCustomer')
205+
->with($userId)
206+
->willThrowException(new NoSuchEntityException());
203207

204208
$this->quoteRepositoryMock->expects($this->once())->method('create')->willReturn($quoteMock);
205209
$quoteMock->expects($this->any())->method('setStoreId')->with($storeId);
@@ -238,7 +242,7 @@ public function testCreateEmptyCartLoggedInUserException()
238242
$this->quoteRepositoryMock
239243
->expects($this->once())
240244
->method('getActiveForCustomer')
241-
->willThrowException(new NoSuchEntityException('123'));
245+
->with($userId);
242246

243247
$this->quoteRepositoryMock->expects($this->never())->method('create')->willReturn($quoteMock);
244248

@@ -404,8 +408,7 @@ public function testAssignCustomerNoSuchCustomer()
404408
$this->quoteRepositoryMock
405409
->expects($this->once())
406410
->method('getForCustomer')
407-
->with($customerId)
408-
->willThrowException(new \Magento\Framework\Exception\NoSuchEntityException());
411+
->with($customerId);
409412

410413
$this->model->assignCustomer($cartId, $customerId, $storeId);
411414
}
@@ -461,7 +464,8 @@ public function testAssignCustomer()
461464
$this->quoteRepositoryMock
462465
->expects($this->once())
463466
->method('getForCustomer')
464-
->with($customerId);
467+
->with($customerId)
468+
->willThrowException(new NoSuchEntityException());
465469

466470
$quoteMock->expects($this->once())->method('setCustomer')->with($customerMock);
467471
$quoteMock->expects($this->once())->method('setCustomerIsGuest')->with(0);

0 commit comments

Comments
 (0)