/**
  * @test
  */
 public function updateBranchEmailConfigurationWhenNotExists()
 {
     $this->branchEmailConfigurationRepository->expects($this->exactly(1))->method('getByBranchId')->with($this->equalTo(self::DUMMY_BRANCH_ID))->will($this->returnValue(null));
     $this->branchRepository->expects($this->once())->method('get')->with($this->equalTo(self::DUMMY_BRANCH_ID))->will($this->returnValue($this->branch));
     $branchEmailConfigurationStub = new BranchEmailConfiguration($this->branch, self::DUMMY_CUSTOMER_DOMAINS, self::DUMMY_SUPPORT_ADDRESS);
     $this->branchEmailConfigurationFactory->expects($this->once())->method('create')->with($this->equalTo($this->branch), $this->equalTo(self::DUMMY_CUSTOMER_DOMAINS), $this->equalTo(self::DUMMY_SUPPORT_ADDRESS))->will($this->returnValue($branchEmailConfigurationStub));
     $this->branchEmailConfigurationRepository->expects($this->once())->method('store')->with($this->equalTo($branchEmailConfigurationStub));
     $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);
 }