16 private $customerSession;
19 private $customerRepository;
32 \
Magento\Framework\View\LayoutInterface::class
37 'customerSession' => $this->customerSession,
38 'customerRepository' => $this->customerRepository
46 public function tearDown()
48 $this->customerSession->setCustomerId(
null);
64 $customer = $this->customerRepository->getById(1);
65 $this->customerSession->setCustomerId(1);
66 $object = $this->block->getCustomer();
68 $this->assertInstanceOf(\
Magento\
Customer\Api\Data\CustomerInterface::class, $object);
78 $this->customerSession->setCustomerId(5);
79 $this->assertFalse($this->block->getPrimaryAddresses());
90 $customer = $this->customerRepository->getById(1);
91 $this->customerSession->setCustomerId(1);
92 $addresses = $this->block->getPrimaryAddresses();
108 $this->customerSession->setCustomerId(1);
109 $addresses = $this->block->getPrimaryAddresses();
112 $this->assertTrue(
$addresses[0]->isDefaultBilling());
113 $this->assertTrue(
$addresses[1]->isDefaultShipping());
testGetPrimaryAddressesNoAddresses()
testGetPrimaryAddressesBillingShippingDifferent()
testGetPrimaryAddressesBillingShippingSame()
static getObjectManager()