mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 07:33:50 +00:00
Change non-static class-level variables and methods to static in tests's data providers
The update modifies several test classes within the "chill-project" to change non-static class-level variables and methods to static ones. This change has been made to improve readability, performance, and to eliminate unnecessary instantiation of class objects in test scenarios. Also, flush and clear actions on the entity manager are moved to individual data providers.
This commit is contained in:
@@ -123,11 +123,12 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase
|
||||
self::assertIsInt($nb, 'test that the query could be executed');
|
||||
}
|
||||
|
||||
public function provideDateForFetchQueryForAccompanyingPeriod(): iterable
|
||||
public static function provideDateForFetchQueryForAccompanyingPeriod(): iterable
|
||||
{
|
||||
$this->setUp();
|
||||
self::bootKernel();
|
||||
$entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
if (null === $period = $this->entityManager->createQuery(
|
||||
if (null === $period = $entityManager->createQuery(
|
||||
'SELECT p FROM '.AccompanyingPeriod::class.' p WHERE SIZE(p.participations) > 0'
|
||||
)
|
||||
->setMaxResults(1)->getSingleResult()) {
|
||||
|
Reference in New Issue
Block a user