Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
12345 anikendra 1
language: php
2
 
3
php:
4
  - 5.2
5
  - 5.3
6
  - 5.4
7
  - 5.5
8
  - 5.6
9
 
10
env:
11
  - DB=mysql
12
  - DB=pgsql
13
  - DB=sqlite
14
 
15
services:
16
  - memcached
17
 
18
matrix:
19
  fast_finish: true
20
  include:
21
    - php: 5.4
22
      env:
23
        - PHPCS=1
24
 
25
 
26
before_script:
27
  - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then composer global require 'phpunit/phpunit=3.7.33'; fi"
28
  - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then ln -s ~/.composer/vendor/phpunit/phpunit/PHPUnit ./vendors/PHPUnit; fi"
29
  - sudo locale-gen de_DE
30
  - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
31
  - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test2;'; fi"
32
  - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test3;'; fi"
33
  - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
34
  - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi"
35
  - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi"
36
  - chmod -R 777 ./app/tmp
37
  - sudo apt-get install lighttpd
38
  - sh -c "if [ '$PHPCS' = '1' ]; then pear channel-discover pear.cakephp.org; fi"
39
  - sh -c "if [ '$PHPCS' = '1' ]; then pear install --alldeps cakephp/CakePHP_CodeSniffer; fi"
40
  - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
41
  - phpenv rehash
42
  - set +H
43
  - echo "<?php
44
    class DATABASE_CONFIG {
45
    private \$identities = array(
46
      'mysql' => array(
47
        'datasource' => 'Database/Mysql',
48
        'host' => '0.0.0.0',
49
        'login' => 'travis'
50
      ),
51
      'pgsql' => array(
52
        'datasource' => 'Database/Postgres',
53
        'host' => '127.0.0.1',
54
        'login' => 'postgres',
55
        'database' => 'cakephp_test',
56
        'schema' => array(
57
          'default' => 'public',
58
          'test' => 'public',
59
          'test2' => 'test2',
60
          'test_database_three' => 'test3'
61
        )
62
      ),
63
      'sqlite' => array(
64
        'datasource' => 'Database/Sqlite',
65
        'database' => array(
66
          'default' => ':memory:',
67
          'test' => ':memory:',
68
          'test2' => '/tmp/cakephp_test2.db',
69
          'test_database_three' => '/tmp/cakephp_test3.db'
70
        ),
71
      )
72
    );
73
    public \$default = array(
74
      'persistent' => false,
75
      'host' => '',
76
      'login' => '',
77
      'password' => '',
78
      'database' => 'cakephp_test',
79
      'prefix' => ''
80
    );
81
    public \$test = array(
82
      'persistent' => false,
83
      'host' => '',
84
      'login' => '',
85
      'password' => '',
86
      'database' => 'cakephp_test',
87
      'prefix' => ''
88
    );
89
    public \$test2 = array(
90
      'persistent' => false,
91
      'host' => '',
92
      'login' => '',
93
      'password' => '',
94
      'database' => 'cakephp_test2',
95
      'prefix' => ''
96
    );
97
    public \$test_database_three = array(
98
      'persistent' => false,
99
      'host' => '',
100
      'login' => '',
101
      'password' => '',
102
      'database' => 'cakephp_test3',
103
      'prefix' => ''
104
    );
105
    public function __construct() {
106
      \$db = 'mysql';
107
      if (!empty(\$_SERVER['DB'])) {
108
        \$db = \$_SERVER['DB'];
109
      }
110
      foreach (array('default', 'test', 'test2', 'test_database_three') as \$source) {
111
        \$config = array_merge(\$this->{\$source}, \$this->identities[\$db]);
112
        if (is_array(\$config['database'])) {
113
          \$config['database'] = \$config['database'][\$source];
114
        }
115
        if (!empty(\$config['schema']) && is_array(\$config['schema'])) {
116
          \$config['schema'] = \$config['schema'][\$source];
117
        }
118
        \$this->{\$source} = \$config;
119
      }
120
    }
121
    }" > app/Config/database.php
122
script:
123
  - sh -c "if [ '$PHPCS' != '1' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; fi"
124
  - sh -c "if [ '$PHPCS' = '1' ]; then phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; fi;"
125
 
126
notifications:
127
  email: false