/** * @test */ public function testBranchDefaultAssigneeRetrieved() { $this->branchRepository->expects($this->once())->method('get')->with($this->equalTo(1))->will($this->returnValue($this->branch)); $this->branch->expects($this->once())->method('getDefaultAssigneeId')->will($this->returnValue(1)); $assignee = $this->branchEmailConfigurationServiceImpl->getBranchDefaultAssignee(1); $this->assertEquals(1, $assignee); }
public function testUpdateProperties() { $this->branchRepository->expects($this->once())->method('get')->will($this->returnValue($this->branch)); $name = 'DUMMY_NAME_UPDT'; $description = 'DUMMY_DESC_UPDT'; $this->branch->expects($this->at(0))->method('updateProperty')->with($this->equalTo('name'), $this->equalTo($name)); $this->branch->expects($this->at(1))->method('updateProperty')->with($this->equalTo('description'), $this->equalTo($description)); $this->branchRepository->expects($this->once())->method('store')->with($this->equalTo($this->branch)); $this->authorizationService->expects($this->once())->method('isActionPermitted')->with($this->equalTo('EDIT'), $this->equalTo('Entity:DiamanteDeskBundle:Branch'))->will($this->returnValue(true)); $command = new UpdatePropertiesCommand(); $command->id = 1; $command->properties = ['name' => $name, 'description' => $description]; $this->branchServiceImpl->updateProperties($command); }