Skip to content

Commit 32c69f2

Browse files
author
abluchet
committed
Add postgres
1 parent f4e931c commit 32c69f2

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ language: php
22

33
sudo: false
44

5+
services:
6+
- postgresql
7+
58
cache:
69
directories:
710
- $HOME/.composer/cache
@@ -21,6 +24,8 @@ matrix:
2124
env: deps='low'
2225
- php: '7.2'
2326
env: SYMFONY_DEPRECATIONS_HELPER=0
27+
- php: '7.2'
28+
env: postgres=1
2429
allow_failures:
2530
env: SYMFONY_DEPRECATIONS_HELPER=0
2631

@@ -29,6 +34,8 @@ before_install:
2934
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
3035
- npm install -g swagger-cli
3136
- export PATH="$PATH:$HOME/.composer/vendor/bin"
37+
- if [[ $postgres = 1 ]]; then psql -c 'create database api_platform_test;' -U postgres; fi
38+
- if [[ $postgres = 1 ]]; then cp tests/Fixtures/app/config/parameters.postgres.yml tests/Fixtures/app/config/parameters.yml; fi
3239
- if [[ $coverage = 1 ]]; then mkdir -p build/logs build/cov; fi
3340
- if [[ $coverage = 1 ]]; then wget https://phar.phpunit.de/phpcov.phar; fi
3441
- if [[ $coverage = 1 ]]; then wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar; fi

tests/Fixtures/app/config/config.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
imports:
22
- { resource: security.yml }
3+
- { resource: parameters.yml }
34

45
framework:
56
secret: 'dunglas.fr'
@@ -19,9 +20,18 @@ framework:
1920

2021
doctrine:
2122
dbal:
22-
driver: 'pdo_sqlite'
23-
path: '%kernel.cache_dir%/db.sqlite'
24-
charset: 'UTF8'
23+
default_connection: '%default_connection%'
24+
connections:
25+
sqlite:
26+
driver: 'pdo_sqlite'
27+
path: '%kernel.cache_dir%/db.sqlite'
28+
charset: 'UTF8'
29+
postgres:
30+
driver: 'pdo_pgsql'
31+
dbname: 'api_platform_test'
32+
user: 'postgres'
33+
password: ''
34+
host: 'localhost'
2535

2636
orm:
2737
auto_generate_proxy_classes: '%kernel.debug%'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
parameters:
2+
default_connection: postgres
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
parameters:
2+
default_connection: sqlite

0 commit comments

Comments
 (0)