Drop SQLite support (#2405)

This commit is contained in:
Kevin Papst
2021-03-08 16:06:22 +01:00
committed by GitHub
parent 70f7f35009
commit 30ac5e4c24
78 changed files with 1165 additions and 1596 deletions

View File

@@ -11,14 +11,13 @@ namespace App\Tests\DataFixtures;
use App\Entity\Activity;
use App\Entity\Project;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
use Faker\Factory;
/**
* Defines the sample data to load in during controller tests.
*/
final class ActivityFixtures extends Fixture
final class ActivityFixtures implements TestFixture
{
/**
* @var int
@@ -95,10 +94,13 @@ final class ActivityFixtures extends Fixture
}
/**
* {@inheritdoc}
* @param ObjectManager $manager
* @return Activity[]
*/
public function load(ObjectManager $manager)
public function load(ObjectManager $manager): array
{
$created = [];
$projects = $this->projects;
if (empty($projects)) {
$projects = $this->getAllProjects($manager);
@@ -126,16 +128,20 @@ final class ActivityFixtures extends Fixture
\call_user_func($this->callback, $activity);
}
$manager->persist($activity);
$created[] = $activity;
}
$manager->flush();
return $created;
}
/**
* @param ObjectManager $manager
* @return array<int|string, Project>
*/
protected function getAllProjects(ObjectManager $manager): array
private function getAllProjects(ObjectManager $manager): array
{
$all = [];
/** @var Project[] $entries */