include:
    - docker/docker-mysql.yml

services:
    test:
        build:
            context: .
            target: ospos_test
        depends_on:
            - mysql
        container_name: ospos_test
        environment:
            - CI_ENVIRONMENT=testing
            - ENCRYPTION_KEY=
            - MYSQL_HOST_NAME=mysql
            - MYSQL_DATABASE=ospos
            - MYSQL_USERNAME=admin
            - MYSQL_PASSWORD=pointofsale
        command: [ "/bin/wait-for-it.sh", "mysql:3306", "--", "/app/vendor/bin/phpunit", "/app/tests" ]
        ports:
            - "80:80"
