예제 #1
0
 /**
  * Tests the method when the address being saved is already persisted.
  */
 public function testSavingAlreadyPersistedAddress()
 {
     $originalAddress = $this->getAddress('42', 'New address');
     $clonedAddress = $this->getAddress(null, 'New address');
     $this->addressObjectManagerMock->expects($this->once())->method('persist')->with($clonedAddress);
     $this->addressObjectManagerMock->expects($this->once())->method('flush')->with($clonedAddress);
     $this->addressEventDispatcher->expects($this->once())->method('dispatchAddressOnCloneEvent');
     $savedAddress = $this->addressManager->saveAddress($originalAddress);
     $this->assertEquals($savedAddress, $clonedAddress, 'The saved address should be a new one');
 }