liip / LiipTestFixturesBundle

This bundles enables efficient loading of Doctrine fixtures in functional test-cases for Symfony applications
https://liip.ch
MIT License
167 stars 45 forks source link

[Bug]: Impossible to set "keep_database_and_schema" #254

Closed JesusRedGar closed 9 months ago

JesusRedGar commented 9 months ago

Preconditions

Version currently installed:

Symfony:

PHP: 8.2

Steps to reproduce

I try to avoid the database and schema creation using the method described in the documentation: https://github.com/liip/LiipTestFixturesBundle/blob/2.x/doc/configuration.md

Setting _keep_database_andschema: true does not prevent from doing so.

I am debugging the execution and in the file: ORMDatabaseTool.php There is the following fragment in line 72:

        if (false === $this->getKeepDatabaseAndSchemaParameter()) {
            $this->createDatabaseIfNotExists();
        }

No matter what I set _keep_database_andschema to, it always get the value false in that line.

It might be an error because the config yaml file is not loaded. I attached a pinture to show where is placed and its content:

image

Not sure how to debufg if this is what is failing.

Expected result

Expected keeping database and schema intact.

Actual result

It does not keep database and schema intact.

JesusRedGar commented 9 months ago

It solved itself... I don't know what happened. But now the configuration from the yaml file is loaded and now it works as expected.

alexislefebvre commented 9 months ago

Do you have something like the following code in the src/Kernel.php file?

$loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');

This code loads the files in config/dev/, config/test/,etc.

JesusRedGar commented 9 months ago
$loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');

I dont have that line or anything similar. But all other packages had load without problems before (and their configurations in /dev /test). That is why I supposed the error was specific of this package.

alexislefebvre commented 9 months ago

Thanks for your report, let's close this issue since it's not reproducible.