em = static::getContainer()->get(EntityManagerInterface::class); } /** * This test only check that the query is ok. * * The semantic of the query is not checked. */ public function testFindWorkflowsWithoutFinalStepAndOlderThanCheckQueryIsOk(): void { $repository = new EntityWorkflowRepository($this->em); $actual = $repository->findWorkflowsWithoutFinalStepAndOlderThan(new \DateTimeImmutable('10 years ago')); self::assertIsArray($actual, 'check that the query is successful'); } public function testCountQueryByDest(): void { $repository = new EntityWorkflowRepository($this->em); $user = $this->em->createQuery(sprintf('SELECT u FROM %s u', User::class)) ->setMaxResults(1)->getSingleResult(); $actual = $repository->countByDest($user); self::assertIsInt($actual); } }