.travis.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. language: php
  2. php:
  3. - 5.3
  4. - 5.4
  5. env:
  6. - CAKE_VERSION=master
  7. - CAKE_VERSION=2.4
  8. before_script:
  9. - git clone --depth 1 git://github.com/cakephp/cakephp ../cakephp && cd ../cakephp && git checkout $CAKE_VERSION
  10. - rm -R app
  11. - git clone --depth 1 git://github.com/dereuromark/tools-app ../app && cd ../app && git checkout master
  12. - cp -R ../Tools plugins/Tools
  13. - sh -c "if [ 'mysql' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
  14. - mkdir ./app/tmp
  15. - chmod -R 777 ./app/tmp
  16. - echo "<?php
  17. class DATABASE_CONFIG {
  18. private \$identities = array(
  19. 'mysql' => array(
  20. 'datasource' => 'Database/Mysql',
  21. 'host' => '0.0.0.0',
  22. 'login' => 'travis'
  23. )
  24. );
  25. public \$default = array(
  26. 'persistent' => false,
  27. 'host' => '',
  28. 'login' => '',
  29. 'password' => '',
  30. 'database' => 'cakephp_test',
  31. 'prefix' => ''
  32. );
  33. public \$test = array(
  34. 'persistent' => false,
  35. 'host' => '',
  36. 'login' => '',
  37. 'password' => '',
  38. 'database' => 'cakephp_test',
  39. 'prefix' => ''
  40. );
  41. public function __construct() {
  42. \$db = 'mysql';
  43. if (!empty(\$_SERVER['DB'])) {
  44. \$db = \$_SERVER['DB'];
  45. }
  46. foreach (array('default', 'test') as \$source) {
  47. \$config = array_merge(\$this->{\$source}, \$this->identities[\$db]);
  48. if (is_array(\$config['database'])) {
  49. \$config['database'] = \$config['database'][\$source];
  50. }
  51. if (!empty(\$config['schema']) && is_array(\$config['schema'])) {
  52. \$config['schema'] = \$config['schema'][\$source];
  53. }
  54. \$this->{\$source} = \$config;
  55. }
  56. }
  57. }" > app/Config/database.php
  58. script:
  59. - ./lib/Cake/Console/cake test Tools AllTools
  60. notifications:
  61. email: false