Aggregators: Update test methods to static and return array

Modified aggregator test methods throughout the Chill project to be now static methods. Also updated yield construction to array returns for more standardised code.
This commit is contained in:
2024-02-16 21:33:57 +01:00
parent 94725bc92f
commit b9ae878791
71 changed files with 162 additions and 214 deletions

View File

@@ -44,17 +44,16 @@ final class AgentAggregatorTest extends AbstractAggregatorTest
return $this->aggregator;
}
public function getFormData(): array
public static function getFormData(): array
{
return [
[],
];
}
public function getQueryBuilders(): array
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
return [

View File

@@ -44,17 +44,16 @@ final class CancelReasonAggregatorTest extends AbstractAggregatorTest
return $this->aggregator;
}
public function getFormData(): array
public static function getFormData(): array
{
return [
[],
];
}
public function getQueryBuilders(): array
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
return [

View File

@@ -44,17 +44,16 @@ final class JobAggregatorTest extends AbstractAggregatorTest
return $this->aggregator;
}
public function getFormData(): array
public static function getFormData(): array
{
return [
[],
];
}
public function getQueryBuilders(): array
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
return [

View File

@@ -44,17 +44,16 @@ final class LocationAggregatorTest extends AbstractAggregatorTest
return $this->aggregator;
}
public function getFormData(): array
public static function getFormData(): array
{
return [
[],
];
}
public function getQueryBuilders(): array
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
return [

View File

@@ -44,17 +44,16 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
return $this->aggregator;
}
public function getFormData(): array
public static function getFormData(): array
{
return [
[],
];
}
public function getQueryBuilders(): array
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
return [

View File

@@ -44,17 +44,16 @@ final class MonthYearAggregatorTest extends AbstractAggregatorTest
return $this->aggregator;
}
public function getFormData(): array
public static function getFormData(): array
{
return [
[],
];
}
public function getQueryBuilders(): array
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
return [

View File

@@ -44,17 +44,16 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest
return $this->aggregator;
}
public function getFormData(): array
public static function getFormData(): array
{
return [
[],
];
}
public function getQueryBuilders(): array
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
return [

View File

@@ -62,11 +62,13 @@ final class AgentFilterTest extends AbstractFilterTest
->getResult();
$data = [];
foreach ($array as $a) {
yield [
$data[] = [
'accepted_agents' => $a,
];
}
self::ensureKernelShutdown();
return $data;
}
public static function getQueryBuilders(): iterable