function it_should_create_project(ProjectRepository $projectRepository, EventDispatcherInterface $eventDispatcher, Project $project, CreateProjectAction $action)
 {
     $action->getName()->willReturn('Foo bar');
     $action->getSlug()->willReturn('foobar');
     $action->getDefaultLocale()->willReturn('fr_FR');
     $action->getDescription()->willReturn('');
     $projectRepository->createNew(Argument::exact(new Slug('foobar')))->willReturn($project);
     $projectRepository->save($project)->shouldBeCalled();
     $eventDispatcher->dispatch(CreateProjectEvent::NAME, Argument::type('Openl10n\\Domain\\Project\\Application\\Event\\CreateProjectEvent'))->shouldBeCalled();
     $this->execute($action)->shouldReturn($project);
 }
 function it_should_edit_project(ProjectRepository $projectRepository, EventDispatcherInterface $eventDispatcher, Project $project, EditProjectAction $action)
 {
     $action->getProject()->willReturn($project);
     $action->getName()->willReturn('Foo Bar');
     $action->getDefaultLocale()->willReturn('fr_FR');
     $action->getDescription()->willReturn('Description');
     $project->setName(Argument::exact(new Name('Foo Bar')))->shouldBeCalled();
     $project->setDefaultLocale(Argument::exact(Locale::parse('fr_FR')))->shouldBeCalled();
     $project->setDescription(Argument::exact('Description'))->shouldBeCalled();
     $projectRepository->save($project)->shouldBeCalled();
     $eventDispatcher->dispatch(EditProjectEvent::NAME, Argument::type('Openl10n\\Domain\\Project\\Application\\Event\\EditProjectEvent'))->shouldBeCalled();
     $this->execute($action)->shouldReturn($project);
 }