Ejemplo n.º 1
0
 function it_counts_without_organization_id(CountProjectsQuery $query, ProjectRepository $repository)
 {
     $query->name()->shouldBeCalled()->willReturn('organization name');
     $query->organizationId()->shouldBeCalled()->willReturn(null);
     $query->userId()->shouldBeCalled()->willReturn('user-id');
     $repository->count(Argument::any())->shouldBeCalled()->willReturn(3);
     $this->__invoke($query)->shouldReturn(3);
 }
Ejemplo n.º 2
0
 public function __invoke(CountProjectsQuery $query)
 {
     return $this->repository->count($this->specificationFactory->buildFilterableSpecification(UserId::generate($query->userId()), null === $query->organizationId() ? null : OrganizationId::generate($query->organizationId()), null === $query->name() ? null : new ProjectName($query->name())));
 }