diff --git a/docs/index.md b/docs/index.md index 07aff20..4f6ca51 100644 --- a/docs/index.md +++ b/docs/index.md @@ -159,6 +159,8 @@ services: ### Fixtures-related +⚠️️ **Warning**: these features are now deprecated and will be removed in the next major version. + * Fast fixtures load Load fixtures simply with `$this->loadFixtures(['YourFixtureClassName', 'YourOtherFixtureClassName'])`. diff --git a/src/Test/WebTestCase.php b/src/Test/WebTestCase.php index 34c9eb5..97b6890 100644 --- a/src/Test/WebTestCase.php +++ b/src/Test/WebTestCase.php @@ -25,7 +25,7 @@ abstract class WebTestCase extends SymfonyWebTestCase { - protected static ?EntityManagerInterface $em = null; + protected static ?EntityManagerInterface $em = null; // @deprecated protected static KernelBrowser $client; private ?AbstractFixture $fixture = null; protected static ?string $authUser = null; @@ -174,6 +174,7 @@ protected static function getTxtFile(string $file = '0'): UploadedFile * * @throws \Doctrine\DBAL\Exception * @throws \InvalidArgumentException + * @deprecated */ protected function loadFixtures( array $fixtures, @@ -181,6 +182,7 @@ protected function loadFixtures( ?string $managerService = null, bool $append = false, ): void { + trigger_error('loadFixtures is deprecated and will be removed in the next major version', E_USER_DEPRECATED); if (null !== $managerService) { $manager = static::$container->get($managerService); if (!$manager instanceof EntityManagerInterface) { @@ -249,9 +251,11 @@ protected static function commandTest( /** * Get an entity by its fixtures reference name. + * @deprecated */ protected function getReference(string $name): object { + trigger_error('getReference is deprecated and will be removed in the next major version', E_USER_DEPRECATED); if (null === $this->fixture) { throw new \RuntimeException('Load some fixtures before.'); } @@ -364,6 +368,7 @@ private static function findCheckbox(Form $form, string $name, string $value): C /** * Load a single fixture class * (with possible other dependent fixture classes). + * @deprecated */ private function loadFixtureClass(Loader $loader, string $className): void {