/** * @test */ public function updateBranchEmailConfigurationWhenExists() { $this->branchEmailConfigurationRepository->expects($this->exactly(2))->method('getByBranchId')->with($this->equalTo(self::DUMMY_BRANCH_ID))->will($this->returnValue($this->branchEmailConfiguration)); $this->branchEmailConfiguration->expects($this->once())->method('update')->with($this->equalTo(self::DUMMY_CUSTOMER_DOMAINS), $this->equalTo(self::DUMMY_SUPPORT_ADDRESS))->will($this->returnValue($this->branchEmailConfiguration)); $this->branchEmailConfigurationRepository->expects($this->once())->method('store'); $command = new BranchEmailConfigurationCommand(); $command->branch = self::DUMMY_BRANCH_ID; $command->customerDomains = self::DUMMY_CUSTOMER_DOMAINS; $command->supportAddress = self::DUMMY_SUPPORT_ADDRESS; $this->branchEmailConfigurationServiceImpl->updateBranchEmailConfiguration($command); }