From 4452a0b920fadb9d68a69edbb4615a56064f0606 Mon Sep 17 00:00:00 2001
From: Bubka <858858+Bubka@users.noreply.github.com>
Date: Fri, 1 Apr 2022 14:09:34 +0200
Subject: [PATCH] Add MySQL tests to Travis config
---
.travis.yml | 16 ++++++++++++++--
phpunit-mysql.xml | 6 +++---
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index b1d460b2..2f2b4971 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,14 +7,26 @@ php:
- 7.4
- 8.0
+services:
+ - mysql
+
+cache:
+ directories:
+ - $HOME/.composer/cache
+ - $HOME/vendor
+
+before_install:
+ - mysql -e 'CREATE DATABASE 2fauth_test;'
+
before_script:
- travis_retry composer self-update
- - travis_retry composer install --no-interaction
+ - travis_retry composer install --no-interaction --prefer-source
# no need to use a dedicated Travis .env file as phpunit
# will use .env.testing by default
script:
- - vendor/bin/phpunit --coverage-clover=coverage.xml
+ - DATABASE=mysql vendor/bin/phpunit -c phpunit-mysql.xml
+ - DATABASE=sqlite vendor/bin/phpunit -c phpunit.xml --coverage-clover=coverage.xml
after_success:
# Submit coverage report to https://codecov.io
diff --git a/phpunit-mysql.xml b/phpunit-mysql.xml
index bf32a736..4559de37 100644
--- a/phpunit-mysql.xml
+++ b/phpunit-mysql.xml
@@ -32,10 +32,10 @@
-
+
-
-
+
+