You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Gedmo\Tests\Tool\BaseTestCaseORM and Gedmo\Tests\Tool\BaseTestCaseOM classes have a hardcoded configuration to create a DBAL connection with an in-memory SQLite database. While that's going to be good enough the overwhelming majority of the time, there can be cases where the behavior across database backends changes in some way (again, going back to the linked issue, how PostgreSQL users specifically have an issue that isn't easily discovered through the current test setup).
The Gedmo\Tests\Tool\BaseTestCaseMongoODM and Gedmo\Tests\Tool\BaseTestCaseOM classes use an env var that can be configured through the PHPUnit config file to pass to the MongoDB\Client constructor. Maybe the ORM test case can do something similar by supporting an env var with a DSN, which when configured is used to create the DBAL connection, and falling back to the current hardcoded config when it isn't set. I mention DSN specifically instead of something like what the DBAL's own test suite does with separate parameters because it'd probably be easier to just use the DBAL's DSN parser than try to manually build the configuration. Yes, I realize that the DSN parser only exists as of DBAL 3.6, but I'd also suggest that in the overwhelming majority of cases, you'd want to run the tests against either the current release or a dev branch and not on a composer update --prefer-lowest build with legacy DBAL versions (or the now EOL'd 2.x branch).
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Branching off from the conversation in #2659
The
Gedmo\Tests\Tool\BaseTestCaseORM
andGedmo\Tests\Tool\BaseTestCaseOM
classes have a hardcoded configuration to create a DBAL connection with an in-memory SQLite database. While that's going to be good enough the overwhelming majority of the time, there can be cases where the behavior across database backends changes in some way (again, going back to the linked issue, how PostgreSQL users specifically have an issue that isn't easily discovered through the current test setup).The
Gedmo\Tests\Tool\BaseTestCaseMongoODM
andGedmo\Tests\Tool\BaseTestCaseOM
classes use an env var that can be configured through the PHPUnit config file to pass to theMongoDB\Client
constructor. Maybe the ORM test case can do something similar by supporting an env var with a DSN, which when configured is used to create the DBAL connection, and falling back to the current hardcoded config when it isn't set. I mention DSN specifically instead of something like what the DBAL's own test suite does with separate parameters because it'd probably be easier to just use the DBAL's DSN parser than try to manually build the configuration. Yes, I realize that the DSN parser only exists as of DBAL 3.6, but I'd also suggest that in the overwhelming majority of cases, you'd want to run the tests against either the current release or a dev branch and not on acomposer update --prefer-lowest
build with legacy DBAL versions (or the now EOL'd 2.x branch).The text was updated successfully, but these errors were encountered: