diff --git a/Dockerfile b/Dockerfile index f305d21..8901426 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,8 @@ RUN apt-get update && apt-get install -y unzip libaio1 # RUN echo 'instantclient,/usr/local/instantclient' | pecl install pdo_oci # RUN echo "extension=pdo_oci.so" > /usr/local/etc/php/conf.d/php-pdo-oci.ini -RUN docker-php-ext-install pdo_mysql +RUN apt-get update && apt-get install -y libpq-dev +RUN docker-php-ext-install pdo_mysql pdo_pgsql # Composer diff --git a/Makefile b/Makefile index 02ee142..9e7f584 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ test-all: vendor/bin/phpunit --testsuite Sqlite,Mysql,Pgsql,Mssql,Oracle test-mysql: vendor/bin/phpunit --testsuite Mysql +test-pgsql: vendor/bin/phpunit --testsuite Pgsql test-oracle: vendor/bin/phpunit --testsuite Oracle test-temp: vendor/bin/phpunit --testsuite Mysql --filter testOffset tests/Mysql/QueryDataReaderTest.php diff --git a/docker-compose.yml b/docker-compose.yml index 36382e3..7bbf8a3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,8 @@ services: depends_on: mysql: condition: service_healthy + postgres: + condition: service_healthy mysql: image: mysql:9 ports: @@ -25,6 +27,22 @@ services: interval: 5s timeout: 5s retries: 20 + postgres: + image: postgres:17 + ports: + - "5432:5432" + volumes: + - type: tmpfs + target: /var/lib/postgresql/data + environment: + POSTGRES_DB: yii + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U postgres" ] + interval: 5s + timeout: 5s + retries: 5 oracle: image: gvenzl/oracle-xe:21 ports: diff --git a/tests/.env b/tests/.env index e1b6927..d2a159a 100644 --- a/tests/.env +++ b/tests/.env @@ -5,8 +5,8 @@ YII_MYSQL_USER=root YII_MYSQL_PASSWORD=root YII_PGSQL_DATABASE=yii -YII_PGSQL_HOST=127.0.0.1 -YII_PGSQL_PORT=15432 +YII_PGSQL_HOST=postgres +YII_PGSQL_PORT=5432 YII_PGSQL_USER=postgres YII_PGSQL_PASSWORD=postgres