2012-03-18 23:29:26 +00:00
|
|
|
language: php
|
|
|
|
|
|
|
|
php:
|
|
|
|
- 5.3
|
|
|
|
- 5.4
|
2013-06-05 10:05:15 +00:00
|
|
|
- 5.5
|
2014-05-11 20:15:35 +00:00
|
|
|
- 5.6
|
2015-11-09 23:11:48 +00:00
|
|
|
- 7.0
|
2016-12-05 14:22:48 +00:00
|
|
|
- 7.1
|
2012-03-18 23:29:26 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
- DB=mysql
|
|
|
|
|
2013-08-27 18:48:36 +00:00
|
|
|
services:
|
|
|
|
- memcached
|
|
|
|
|
2012-11-02 14:51:35 +00:00
|
|
|
matrix:
|
2014-05-23 18:05:09 +00:00
|
|
|
fast_finish: true
|
2012-11-02 14:51:35 +00:00
|
|
|
include:
|
2014-08-11 17:45:43 +00:00
|
|
|
- php: 5.4
|
2014-08-11 16:04:35 +00:00
|
|
|
env: DB=pgsql
|
|
|
|
|
2014-08-11 17:45:43 +00:00
|
|
|
- php: 5.4
|
2014-08-11 16:04:35 +00:00
|
|
|
env: DB=sqlite
|
|
|
|
|
2016-12-05 14:22:48 +00:00
|
|
|
- php: 7.0
|
2014-08-11 16:04:35 +00:00
|
|
|
env: PHPCS=1
|
2012-11-02 14:51:35 +00:00
|
|
|
|
2014-05-23 18:00:29 +00:00
|
|
|
|
2012-03-18 23:29:26 +00:00
|
|
|
before_script:
|
2015-06-15 02:17:22 +00:00
|
|
|
- sh -c "composer global require 'phpunit/phpunit=3.7.33'"
|
|
|
|
- sh -c "ln -s ~/.composer/vendor/phpunit/phpunit/PHPUnit ./vendors/PHPUnit"
|
2013-08-14 19:08:25 +00:00
|
|
|
- sudo locale-gen de_DE
|
2016-07-01 21:15:23 +00:00
|
|
|
- sudo locale-gen es_ES
|
2012-03-18 23:29:26 +00:00
|
|
|
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
|
|
|
|
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test2;'; fi"
|
|
|
|
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test3;'; fi"
|
|
|
|
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
|
|
|
|
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi"
|
|
|
|
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi"
|
|
|
|
- chmod -R 777 ./app/tmp
|
2015-08-20 13:59:46 +00:00
|
|
|
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.3" ]] ; then pecl install timezonedb ; fi
|
2014-12-16 04:46:22 +00:00
|
|
|
- sh -c "if [ '$PHPCS' = '1' ]; then composer global require 'cakephp/cakephp-codesniffer:1.*'; fi"
|
2014-11-30 17:23:09 +00:00
|
|
|
- sh -c "if [ '$PHPCS' = '1' ]; then ~/.composer/vendor/bin/phpcs --config-set installed_paths ~/.composer/vendor/cakephp/cakephp-codesniffer; fi"
|
2013-08-27 18:48:36 +00:00
|
|
|
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
2017-03-11 17:33:11 +00:00
|
|
|
- if [[ ${TRAVIS_PHP_VERSION:0:1} == "7" ]] ; then echo "yes" | pecl install apcu-5.1.3 || true; fi
|
|
|
|
- if [[ ${TRAVIS_PHP_VERSION:0:1} == "5" ]] ; then echo "yes" | pecl install apcu-4.0.11 || true; fi
|
2016-05-07 06:42:37 +00:00
|
|
|
- echo -e "extension = apcu.so\napc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
2012-11-02 14:51:35 +00:00
|
|
|
- phpenv rehash
|
2012-03-18 23:29:26 +00:00
|
|
|
- set +H
|
|
|
|
- echo "<?php
|
|
|
|
class DATABASE_CONFIG {
|
|
|
|
private \$identities = array(
|
|
|
|
'mysql' => array(
|
|
|
|
'datasource' => 'Database/Mysql',
|
|
|
|
'host' => '0.0.0.0',
|
|
|
|
'login' => 'travis'
|
|
|
|
),
|
|
|
|
'pgsql' => array(
|
|
|
|
'datasource' => 'Database/Postgres',
|
|
|
|
'host' => '127.0.0.1',
|
|
|
|
'login' => 'postgres',
|
|
|
|
'database' => 'cakephp_test',
|
|
|
|
'schema' => array(
|
|
|
|
'default' => 'public',
|
|
|
|
'test' => 'public',
|
|
|
|
'test2' => 'test2',
|
|
|
|
'test_database_three' => 'test3'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
'sqlite' => array(
|
|
|
|
'datasource' => 'Database/Sqlite',
|
|
|
|
'database' => array(
|
|
|
|
'default' => ':memory:',
|
|
|
|
'test' => ':memory:',
|
|
|
|
'test2' => '/tmp/cakephp_test2.db',
|
|
|
|
'test_database_three' => '/tmp/cakephp_test3.db'
|
|
|
|
),
|
|
|
|
)
|
|
|
|
);
|
|
|
|
public \$default = array(
|
|
|
|
'persistent' => false,
|
|
|
|
'host' => '',
|
|
|
|
'login' => '',
|
|
|
|
'password' => '',
|
|
|
|
'database' => 'cakephp_test',
|
|
|
|
'prefix' => ''
|
|
|
|
);
|
|
|
|
public \$test = array(
|
|
|
|
'persistent' => false,
|
|
|
|
'host' => '',
|
|
|
|
'login' => '',
|
|
|
|
'password' => '',
|
|
|
|
'database' => 'cakephp_test',
|
|
|
|
'prefix' => ''
|
|
|
|
);
|
|
|
|
public \$test2 = array(
|
|
|
|
'persistent' => false,
|
|
|
|
'host' => '',
|
|
|
|
'login' => '',
|
|
|
|
'password' => '',
|
|
|
|
'database' => 'cakephp_test2',
|
|
|
|
'prefix' => ''
|
|
|
|
);
|
|
|
|
public \$test_database_three = array(
|
|
|
|
'persistent' => false,
|
|
|
|
'host' => '',
|
|
|
|
'login' => '',
|
|
|
|
'password' => '',
|
|
|
|
'database' => 'cakephp_test3',
|
|
|
|
'prefix' => ''
|
|
|
|
);
|
|
|
|
public function __construct() {
|
|
|
|
\$db = 'mysql';
|
|
|
|
if (!empty(\$_SERVER['DB'])) {
|
|
|
|
\$db = \$_SERVER['DB'];
|
|
|
|
}
|
|
|
|
foreach (array('default', 'test', 'test2', 'test_database_three') as \$source) {
|
|
|
|
\$config = array_merge(\$this->{\$source}, \$this->identities[\$db]);
|
|
|
|
if (is_array(\$config['database'])) {
|
|
|
|
\$config['database'] = \$config['database'][\$source];
|
|
|
|
}
|
|
|
|
if (!empty(\$config['schema']) && is_array(\$config['schema'])) {
|
|
|
|
\$config['schema'] = \$config['schema'][\$source];
|
|
|
|
}
|
|
|
|
\$this->{\$source} = \$config;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}" > app/Config/database.php
|
|
|
|
script:
|
2014-06-28 03:14:09 +00:00
|
|
|
- sh -c "if [ '$PHPCS' != '1' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; fi"
|
2014-11-30 17:23:09 +00:00
|
|
|
- sh -c "if [ '$PHPCS' = '1' ]; then ~/.composer/vendor/bin/phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; fi;"
|
2012-03-18 23:29:26 +00:00
|
|
|
|
|
|
|
notifications:
|
2013-06-05 10:05:15 +00:00
|
|
|
email: false
|