Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
14 changes: 14 additions & 0 deletions .env.postgres.travis
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
APP_ENV=testing
APP_KEY=base64:NTrXToqFZJlv48dgPc+kNpc3SBt333TfDnF1mDShsBg=

DB_CONNECTION=pgsqltesting
DB_TEST_HOST=127.0.0.1
DB_TEST_DATABASE=monica
DB_TEST_USERNAME=postgres
DB_TEST_PASSWORD=

CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync

2FA_ENABLED=true
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ php:

services:
- mysql
- postgresql
env:
- DB=mysql
- DB=postgres

jdk:
- oraclejdk8
Expand All @@ -25,9 +29,11 @@ env:
# - SAUCELABS=1

before_script:
- cp .env.travis .env
- sh -c "if [ '$DB' = 'postgres' ]; then cp .env.postgres.travis .env; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then cp .env.mysql.travis .env; fi"
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'CREATE DATABASE monica;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE monica;'; fi"
- mkdir -p $TRAVIS_BUILD_DIR/results/coverage
- mysql -e 'create database monica;'
- composer self-update
- travis_retry composer install --no-interaction --prefer-dist --no-suggest
- if [ ! "$SAUCELABS" = "1" ]; then .ci/start-selenium.sh; fi
Expand Down
29 changes: 21 additions & 8 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@
],

'testing' => [
'driver' => 'mysql',
'host' => env('DB_TEST_HOST'),
'database' => env('DB_TEST_DATABASE'),
'username' => env('DB_TEST_USERNAME'),
'password' => env('DB_TEST_PASSWORD'),
'charset' => 'utf8',
'driver' => 'mysql',
'host' => env('DB_TEST_HOST'),
'database' => env('DB_TEST_DATABASE'),
'username' => env('DB_TEST_USERNAME'),
'password' => env('DB_TEST_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'prefix' => '',
'strict' => false,
],

'pgsql' => [
Expand All @@ -90,6 +90,19 @@
'schema' => 'public',
],

'pgsqltesting' => [
'driver' => 'pgsql',
'host' => env('DB_TEST_HOST'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_TEST_DATABASE'),
'username' => env('DB_TEST_USERNAME'),
'password' => env('DB_TEST_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'schema' => 'public',
],

],

/*
Expand Down