Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 111 lines (106 sloc) 3.305 kb
e8993b5 @ceeram add .travis.yml file
ceeram authored
1 language: php
2
3 php:
fda0651 @tPl0ch Fixed test cases for successful being built on travis.
tPl0ch authored
4 - 5.2
e8993b5 @ceeram add .travis.yml file
ceeram authored
5 - 5.3
6 - 5.4
7
8 env:
9 - DB=mysql
10 - DB=pgsql
11 - DB=sqlite
12
13 before_script:
14 - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
15 - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test2;'; fi"
16 - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test3;'; fi"
17 - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
18 - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi"
19 - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi"
20 - chmod -R 777 ./app/tmp
21 - echo "var net = require('net');
22 var server = net.createServer();
23 server.listen(80, 'localhost');
24 console.log('TCP server listening on port 80 at localhost.');" > app/tmp/socket.js
25 - sudo node ./app/tmp/socket.js &
26 - set +H
27 - echo "<?php
28 class DATABASE_CONFIG {
29 private \$identities = array(
30 'mysql' => array(
31 'datasource' => 'Database/Mysql',
32 'host' => '0.0.0.0',
33 'login' => 'travis'
34 ),
35 'pgsql' => array(
36 'datasource' => 'Database/Postgres',
37 'host' => '127.0.0.1',
38 'login' => 'postgres',
39 'database' => 'cakephp_test',
40 'schema' => array(
41 'default' => 'public',
42 'test' => 'public',
43 'test2' => 'test2',
44 'test_database_three' => 'test3'
45 )
46 ),
47 'sqlite' => array(
48 'datasource' => 'Database/Sqlite',
49 'database' => array(
50 'default' => ':memory:',
51 'test' => ':memory:',
52 'test2' => '/tmp/cakephp_test2.db',
53 'test_database_three' => '/tmp/cakephp_test3.db'
54 ),
55 )
56 );
57 public \$default = array(
58 'persistent' => false,
59 'host' => '',
60 'login' => '',
61 'password' => '',
62 'database' => 'cakephp_test',
63 'prefix' => ''
64 );
65 public \$test = array(
66 'persistent' => false,
67 'host' => '',
68 'login' => '',
69 'password' => '',
70 'database' => 'cakephp_test',
71 'prefix' => ''
72 );
73 public \$test2 = array(
74 'persistent' => false,
75 'host' => '',
76 'login' => '',
77 'password' => '',
78 'database' => 'cakephp_test2',
79 'prefix' => ''
80 );
81 public \$test_database_three = array(
82 'persistent' => false,
83 'host' => '',
84 'login' => '',
85 'password' => '',
86 'database' => 'cakephp_test3',
87 'prefix' => ''
88 );
89 public function __construct() {
90 \$db = 'mysql';
91 if (!empty(\$_SERVER['DB'])) {
92 \$db = \$_SERVER['DB'];
93 }
94 foreach (array('default', 'test', 'test2', 'test_database_three') as \$source) {
95 \$config = array_merge(\$this->{\$source}, \$this->identities[\$db]);
96 if (is_array(\$config['database'])) {
97 \$config['database'] = \$config['database'][\$source];
98 }
99 if (!empty(\$config['schema']) && is_array(\$config['schema'])) {
100 \$config['schema'] = \$config['schema'][\$source];
101 }
102 \$this->{\$source} = \$config;
103 }
104 }
105 }" > app/Config/database.php
106
107 script:
108 - ./lib/Cake/Console/cake test core AllTests --stderr
109
110 notifications:
111 email: false
Something went wrong with that request. Please try again.