diff --git a/modules/cart/tests/src/Unit/CartProviderTest.php b/modules/cart/tests/src/Unit/CartProviderTest.php index cb44d1e..2dfa8c2 100644 --- a/modules/cart/tests/src/Unit/CartProviderTest.php +++ b/modules/cart/tests/src/Unit/CartProviderTest.php @@ -7,8 +7,8 @@ use Drupal\commerce_cart\CartSessionInterface; use Drupal\commerce_cart\Exception\DuplicateCartException; use Drupal\commerce_order\Entity\OrderInterface; use Drupal\commerce_store\Entity\StoreInterface; -use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityStorageInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\Query\QueryInterface; use Drupal\Tests\UnitTestCase; use Drupal\user\UserInterface; @@ -79,6 +79,7 @@ class CartProviderTest extends UnitTestCase { // We need a registered user and an anonymous user to create the tests. $mockAccountBuilder = $this->getMockBuilder(UserInterface::class); + // Setup anonymous user and it's expectations. $this->anonymousUser = $mockAccountBuilder->getMock(); $this->anonymousUser->expects($this->any()) ->method('isAuthenticated') @@ -90,6 +91,7 @@ class CartProviderTest extends UnitTestCase { ->method('id') ->willReturn(0); + // Setup registered user and it's expectations. $this->registeredUser = $mockAccountBuilder->getMock(); $this->registeredUser->expects($this->any()) ->method('isAuthenticated') @@ -129,6 +131,8 @@ class CartProviderTest extends UnitTestCase { $this->firstOrder->expects($this->any()) ->method('id') ->willReturn(1); + // There's only an empty() check on the cart content, so fill it with + // something that passes that check. $this->firstOrder->cart = 'cart contents'; // We need a second order for the getCarts and getCartIds method tests. @@ -220,7 +224,7 @@ class CartProviderTest extends UnitTestCase { ->willReturn($orders); // Mock the entityManager for the get and create tests. - $mockEntityManagerBuilder = $this->getMockBuilder(EntityManagerInterface::class); + $mockEntityManagerBuilder = $this->getMockBuilder(EntityTypeManagerInterface::class); $this->createEntityManager = $mockEntityManagerBuilder->getMock(); $this->createEntityManager->expects($this->any())