Exemplo n.º 1
0
 public function testCustomer()
 {
     $this->address->unsetData('cusomer_id');
     $this->assertFalse($this->address->getCustomer());
     $this->address->setCustomerId(self::ORIG_CUSTOMER_ID);
     $customer = $this->address->getCustomer();
     $this->assertEquals(self::ORIG_CUSTOMER_ID, $customer->getId());
     /** @var \Magento\Customer\Model\Customer $customer */
     $customer = $this->getMockBuilder('Magento\\Customer\\Model\\Customer')->disableOriginalConstructor()->getMock();
     $customer->expects($this->any())->method('getId')->will($this->returnValue(self::ORIG_CUSTOMER_ID + 1));
     $this->address->setCustomer($customer);
     $this->assertEquals(self::ORIG_CUSTOMER_ID + 1, $this->address->getCustomerId());
 }