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('now'))->add(new \DateInterval('P10Y'))); self::assertIsIterable($actual, 'check that the query is successful'); foreach ($actual as $entityWorkflow) { self::assertInstanceOf(EntityWorkflow::class, $entityWorkflow); } } 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); } }