Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
87 lines (81 sloc) 2.34 KB
language: php
php:
- 5.3
env:
- CAKE_VERSION=2.2
- CAKE_VERSION=2.3
env:
- DB=mysql
before_script:
- cd .. && git clone git://github.com/cakephp/cakephp && cd cakephp && git checkout $CAKE_VERSION
- cd .. && ln -s cakephp/lib lib
- cd infinitas
- chmod -R 777 tmp
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE infinitas_test;'; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE infinitas_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA infinitas_test;' -U postgres -d infinitas_test; fi"
- 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' => 'infinitas_test',
'schema' => array(
'default' => 'public',
'test' => 'infinitas_test',
)
),
'sqlite' => array(
'datasource' => 'Database/Sqlite',
'database' => array(
'default' => ':memory:',
'test' => ':memory:',
),
)
);
public \$default = array(
'persistent' => false,
'host' => '',
'login' => '',
'password' => '',
'database' => 'infinitas_test',
'prefix' => ''
);
public \$test = array(
'persistent' => false,
'host' => '',
'login' => '',
'password' => '',
'database' => 'infinitas_test',
'prefix' => ''
);
public function __construct() {
\$db = 'mysql';
if (!empty(\$_SERVER['DB'])) {
\$db = \$_SERVER['DB'];
}
foreach (array('default', 'test') 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;
}
}
}" > Config/database.php
script:
- Console/cake test app AllTests --stderr
notifications:
irc: "irc.freenode.org#infinitas"
email: false
Something went wrong with that request. Please try again.