Last active
November 18, 2017 17:59
-
-
Save rrd108/d366cca7feb33825e6989ba3fad049de to your computer and use it in GitHub Desktop.
CakePHP Travis MySQL 5.7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections | |
wget https://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb | |
sudo dpkg --install mysql-apt-config_0.7.3-1_all.deb | |
sudo apt-get update -q | |
sudo apt-get install -q -y --allow-unauthenticated -o Dpkg::Options::=--force-confnew mysql-server | |
sudo mysql_upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: php | |
dist: trusty | |
sudo: true | |
php: | |
- 5.6 | |
- 7.0 | |
- 7.1 | |
env: | |
- DB=mysql db_dsn='mysql://root@127.0.0.1/cakephp_test' | |
services: | |
- mysql | |
matrix: | |
fast_finish: true | |
before_script: | |
- bash .travis.install-mysql-5.7.sh | |
- mysql -u root -e "CREATE DATABASE cakephp_test;" | |
- composer update; | |
- composer run-script post-install-cmd --no-interaction; | |
script: | |
- vendor/bin/phpunit; | |
notifications: | |
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// at Datasources, around line 266 | |
'test' => [ | |
'className' => 'Cake\Database\Connection', | |
'driver' => 'Cake\Database\Driver\Mysql', | |
'persistent' => false, | |
'host' => 'localhost', | |
//'port' => 'non_standard_port_number', | |
'username' => 'root', | |
'password' => '', | |
'database' => 'cakephp_test', | |
'encoding' => 'utf8', | |
'timezone' => 'UTC', | |
'cacheMetadata' => true, | |
'quoteIdentifiers' => false, | |
'log' => false, | |
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'], | |
'url' => env('DATABASE_TEST_URL', null), | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
"require-dev": { | |
... | |
"phpunit/phpunit": "^5.7|^6.0" | |
}, | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment