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

@@ -50,7 +50,7 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest
);
}
public function getFormData()
public static function getFormData(): array
{
return [
[
@@ -72,10 +72,9 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest
];
}
public function getQueryBuilders()
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
return [

View File

@@ -37,17 +37,16 @@ final class BySocialActionAggregatorTest 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

@@ -37,17 +37,16 @@ final class BySocialIssueAggregatorTest 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

@@ -40,17 +40,16 @@ class ActivityPresenceAggregatorTest extends AbstractAggregatorTest
return new ActivityPresenceAggregator($this->activityPresenceRepository, $this->translatableStringHelper);
}
public function getFormData()
public static function getFormData(): array
{
return [
[],
];
}
public function getQueryBuilders()
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
return [

View File

@@ -49,7 +49,7 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
return $this->aggregator;
}
public function getFormData(): array
public static function getFormData(): array
{
return [
['level' => 'reasons'],
@@ -57,10 +57,9 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
];
}
public function getQueryBuilders(): array
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
return [

View File

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

View File

@@ -50,17 +50,16 @@ final class ActivityUserAggregatorTest 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

@@ -37,17 +37,16 @@ final class ByThirdpartyAggregatorTest 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

@@ -37,17 +37,16 @@ final class ByUserAggregatorTest 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

@@ -37,17 +37,16 @@ final class CreatorJobAggregatorTest 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

@@ -37,17 +37,16 @@ final class CreatorScopeAggregatorTest 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

@@ -37,7 +37,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
return $this->aggregator;
}
public function getFormData(): array
public static function getFormData(): array
{
return [
[
@@ -52,10 +52,9 @@ final class DateAggregatorTest extends AbstractAggregatorTest
];
}
public function getQueryBuilders(): array
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
return [

View File

@@ -37,17 +37,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

@@ -37,15 +37,14 @@ class PersonAggregatorTest extends AbstractAggregatorTest
return new PersonAggregator($this->labelPersonHelper);
}
public function getFormData()
public static function getFormData(): array
{
return [[]];
}
public function getQueryBuilders()
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
return [

View File

@@ -38,17 +38,16 @@ class PersonsAggregatorTest extends AbstractAggregatorTest
return new PersonsAggregator($this->labelPersonHelper);
}
public function getFormData()
public static function getFormData(): array
{
return [
[],
];
}
public function getQueryBuilders()
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
return [