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.3
5
  - 5.4
6
  - 5.5
7
 
8
env:
9
  - CAKE_VERSION=2.3.10 DB=mysql
10
  - CAKE_VERSION=2.3.10 DB=pgsql
11
  - CAKE_VERSION=2.4.10 DB=mysql
12
  - CAKE_VERSION=2.4.10 DB=pgsql
13
  - CAKE_VERSION=master DB=mysql
14
  - CAKE_VERSION=master DB=pgsql
15
 
16
install:
17
  - git clone git://github.com/cakephp/cakephp ../cakephp && cd ../cakephp && git checkout $CAKE_VERSION
18
  - cp -R ../debug_kit plugins/DebugKit
19
  - chmod -R 777 ../cakephp/app/tmp
20
  - sh -c "composer global require 'phpunit/phpunit=3.7.33'"
21
  - sh -c "ln -s ~/.composer/vendor/phpunit/phpunit/PHPUnit ../cakephp/vendors/PHPUnit"
22
 
23
before_script:
24
  - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
25
  - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
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
        )
44
      )
45
    );
46
    public \$default = array(
47
      'persistent' => false,
48
      'host' => '',
49
      'login' => '',
50
      'password' => '',
51
      'database' => 'cakephp_test',
52
      'prefix' => ''
53
    );
54
    public \$test = array(
55
      'persistent' => false,
56
      'host' => '',
57
      'login' => '',
58
      'password' => '',
59
      'database' => 'cakephp_test',
60
      'prefix' => ''
61
    );
62
    public function __construct() {
63
      \$db = 'mysql';
64
      if (!empty(\$_SERVER['DB'])) {
65
        \$db = \$_SERVER['DB'];
66
      }
67
      foreach (array('default', 'test') as \$source) {
68
        \$config = array_merge(\$this->{\$source}, \$this->identities[\$db]);
69
        if (is_array(\$config['database'])) {
70
          \$config['database'] = \$config['database'][\$source];
71
        }
72
        if (!empty(\$config['schema']) && is_array(\$config['schema'])) {
73
          \$config['schema'] = \$config['schema'][\$source];
74
        }
75
        \$this->{\$source} = \$config;
76
      }
77
    }
78
    }" > ../cakephp/app/Config/database.php
79
 
80
script:
81
  - ./lib/Cake/Console/cake test DebugKit AllDebugKit --stderr
82
 
83
notifications:
84
  email: false