test-pack
test-pack copied to clipboard
Add TestContainers Support
Nowdays Testcontainers is very popular for writing integration test for database, etc. on local machines.
TestContainers officially support a collection of programming languages, but lacks PHP support.
Check here: https://testcontainers.com/getting-started/
There is a PHP implementation from the community, https://github.com/shyim/testcontainer
Hope there is official bundle to integrate Testscontainers(running Docker on local machine) and Testcontainers cloud APIs(running Docker containers remotely).
There are a few attempts at porting TestContainers to PHP but none are done or 'official' yet.
I'm unclear what Symfony-specific support would look like?
I have tried to shyim/testcontainer in my Symfony sample project, https://github.com/hantsy/symfony-rest-sample/pull/387/files, and just used the PostgresContainer, it lacks a lot of features that provided in TestContainers Java implementation.
For example, the following features I used frequently in testconainters Java.
- print pull and starting log.
- Random ports exposed.
- copy init.sql to docker container etc.
Dagger looks nice on the topic. See https://github.com/symfony/symfony/pull/59240 for some efforts to use it for Symfony itself. Let me close as this repo is not the one where this should be discussed (nobody tracks this repo)