/**
  * @test
  */
 public function createBranchWithAllValues()
 {
     $key = 'DB';
     $name = 'DUMMY_NAME';
     $description = 'DUMMY_DESC';
     $assigneeId = 1;
     $assignee = new User($assigneeId, User::TYPE_ORO);
     $defaultAssignee = new OroUser();
     $tags = array();
     $branch = new Branch($key, $name, $description, null, new Logo('dummy'));
     $this->fileMock = new UploadedFileStub(self::DUMMY_LOGO_PATH, self::DUMMY_LOGO_NAME);
     $logoMock = new Logo($this->fileMock->getFilename(), $this->fileMock->getClientOriginalName());
     $this->registry->expects($this->once())->method('getRepository')->with($this->equalTo('OroUserBundle:User'))->will($this->returnValue($this->userRepo));
     $this->userRepo->expects($this->once())->method('find')->with($this->equalTo($assigneeId))->will($this->returnValue($defaultAssignee));
     $this->branchLogoHandler->expects($this->once())->method('upload')->with($this->equalTo($this->fileMock))->will($this->returnValue($this->fileMock));
     $this->branchFactory->expects($this->once())->method('create')->with($this->equalTo($name), $this->equalTo($description), $key, $this->equalTo($defaultAssignee), $this->equalTo($logoMock))->will($this->returnValue($branch));
     $this->tagManager->expects($this->once())->method('saveTagging')->with($this->equalTo($branch));
     $this->registry->expects($this->exactly(2))->method('getManager')->will($this->returnValue($this->entityManager));
     $this->entityManager->expects($this->once())->method('persist')->with($branch);
     $this->entityManager->expects($this->once())->method('flush');
     $this->authorizationService->expects($this->once())->method('isActionPermitted')->with($this->equalTo('CREATE'), $this->equalTo('Entity:DiamanteDeskBundle:Branch'))->will($this->returnValue(true));
     $command = new BranchCommand();
     $command->key = $key;
     $command->name = $name;
     $command->description = $description;
     $command->defaultAssignee = $assigneeId;
     $command->tags = $tags;
     $command->logoFile = $this->fileMock;
     $this->branchServiceImpl->createBranch($command);
 }