when@test:
doctrine:
dbal:
# "TEST_TOKEN" is typically set by ParaTest
dbname_suffix: '_test%env(default::TEST_TOKEN)%'
Expected result
The tests run.
Actual result
Doctrine\DBAL\Exception\ConnectionException : An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at "postgres", port 5432 failed: FATAL: database "user" does not exist is shown in all tests.
In ORMDatabaseTool::createDatabaseIfNotExists() the dbname and url parameters are unset. When I comment the line, the tests run again. As there is a comment below the code, it seems that there is a reason for unsetting those that point to SQLite. However it does not work with the dependency set as given above and a PostgreSQL Database.
Preconditions
Steps to reproduce
Connection string:
DATABASE_URL="postgresql://user:password@postgres:5432/database?serverVersion=14.5&charset=utf8"
Doctrine test config:
Expected result
The tests run.
Actual result
Doctrine\DBAL\Exception\ConnectionException : An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at "postgres", port 5432 failed: FATAL: database "user" does not exist
is shown in all tests.Investigation
https://github.com/liip/LiipTestFixturesBundle/blob/203df6491eb0d2981317030cca06ecd598b48eda/src/Services/DatabaseTools/ORMDatabaseTool.php#L131-L134
In
ORMDatabaseTool::createDatabaseIfNotExists()
thedbname
andurl
parameters are unset. When I comment the line, the tests run again. As there is a comment below the code, it seems that there is a reason for unsetting those that point to SQLite. However it does not work with the dependency set as given above and a PostgreSQL Database.