Skip to content

Commit

Permalink
fix test - mysql port int
Browse files Browse the repository at this point in the history
  • Loading branch information
janatjak committed Aug 5, 2018
1 parent d56cb21 commit 7a9dda0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
34 changes: 20 additions & 14 deletions .travis.yml
Expand Up @@ -4,24 +4,22 @@ dist: trusty

sudo: false

services:
- postgresql

addons:
postgresql: '9.6' # require 9.5+ (on conflict query)
mariadb: '10.0'
mariadb: '10'

cache:
directories:
- $HOME/.composer/cache

php:
- 7.1
- 7.2

install:
- composer install --no-interaction --prefer-dist

before_script:
script:
# Init Postgre database
- psql -c 'CREATE DATABASE inline;' -U postgres
- psql inline < tests/sql/postgres.sql
Expand All @@ -31,13 +29,21 @@ before_script:
- mysql -u root inline < tests/sql/mysql.sql
- mysql -e 'SET PASSWORD FOR "root"@"localhost" = PASSWORD("");'

script:
# Run tests
- php vendor/bin/phpstan analyse ./src ./tests --level 7 -c phpstan.neon
- php vendor/bin/phpcs --standard=PSR2 ./src ./tests
- php vendor/bin/tester tests -p phpdbg --coverage ./coverage.xml --coverage-src ./src

after_script:
# Report Code Coverage
- >
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
&& php coveralls.phar --verbose --config .coveralls.yml
- php vendor/bin/tester ./tests

jobs:
include:
- stage: Code Standard Checker
php: 7.2
script:
- php vendor/bin/phpcs --standard=PSR2 ./src ./tests

- stage: Code Coverage
php: 7.2
script:
- php vendor/bin/tester tests -p phpdbg --coverage ./coverage.xml --coverage-src ./src
after_script:
- wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
- php coveralls.phar --verbose --config ./.coveralls.yml
Expand Up @@ -25,6 +25,7 @@ class DibiPersistenceTestCase extends BasePersistenceTestCase

if ($params['driver'] === 'pdo_mysql') {
$params['driver'] = 'mysqli';
$params['port'] = 3306; // must be int
} elseif ($params['driver'] === 'pdo_pgsql') {
$params['driver'] = 'postgre';
$params['string'] = 'host=' . $params['host'] . ' port=' . $params['port'] . ' dbname=' . $params['dbname'];
Expand Down

0 comments on commit 7a9dda0

Please sign in to comment.