public function testDeleteById()
 {
     $addressId = 12;
     $customerId = 43;
     $this->address->expects($this->once())->method('getCustomerId')->willReturn($customerId);
     $addressCollection = $this->getMock('Magento\\Customer\\Model\\ResourceModel\\Address\\Collection', [], [], '', false);
     $this->addressRegistry->expects($this->once())->method('retrieve')->with($addressId)->willReturn($this->address);
     $this->customerRegistry->expects($this->once())->method('retrieve')->with($customerId)->willReturn($this->customer);
     $this->customer->expects($this->once())->method('getAddressesCollection')->willReturn($addressCollection);
     $addressCollection->expects($this->once())->method('clear');
     $this->addressResourceModel->expects($this->once())->method('delete')->with($this->address);
     $this->addressRegistry->expects($this->once())->method('remove')->with($addressId);
     $this->assertTrue($this->repository->deleteById($addressId));
 }
예제 #2
0
 public function testGetType()
 {
     $this->assertSame($this->eavConfigType, $this->addressResource->getEntityType());
 }