Set DB to a known state
“scripts”: { “reset-db”: [ “bin/console doctrine:database:drop —force”, “bin/console doctrine:database:create”, “bin/console doctrine:schema:update —force”
Using composer scripts
], “populate-db”: [ “bin/console doctrine:fixtures:load” ] }
Slide 14
Docker Compose
Slide 15
Update Docker image
Update Docker image ●
Add mysql client
Slide 16
Run integration tests using Docker Compose
If docker compose is not already running: docker-compose up —build -d
Run tests from inside the running container: docker-compose exec -T phpminds-php sh -c “bin/phpunit -c tests/phpunit/phpunit.xml —group integration”
Slide 17
Docker Compose in Bitbucket Pipelines
Steps required ● ● ● ● ● ● ●
Install Docker Compose docker-compose up —build -d composer install (wait for DB container to start) composer reset-db composer populate-db bin/phpunit -c tests/phpunit/phpunit.xml —group integration