Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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