.travis.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. - cd ..
  13. - cp -R ../tools plugins/Tools
  14. - sh -c "if [ 'mysql' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
  15. - mkdir ./app/tmp
  16. - chmod -R 777 ./app/tmp
  17. - echo "<?php
  18. class DATABASE_CONFIG {
  19. private \$identities = array(
  20. 'mysql' => array(
  21. 'datasource' => 'Database/Mysql',
  22. 'host' => '0.0.0.0',
  23. 'login' => 'travis'
  24. )
  25. );
  26. public \$default = array(
  27. 'persistent' => false,
  28. 'host' => '',
  29. 'login' => '',
  30. 'password' => '',
  31. 'database' => 'cakephp_test',
  32. 'prefix' => ''
  33. );
  34. public \$test = array(
  35. 'persistent' => false,
  36. 'host' => '',
  37. 'login' => '',
  38. 'password' => '',
  39. 'database' => 'cakephp_test',
  40. 'prefix' => ''
  41. );
  42. public function __construct() {
  43. \$db = 'mysql';
  44. if (!empty(\$_SERVER['DB'])) {
  45. \$db = \$_SERVER['DB'];
  46. }
  47. foreach (array('default', 'test') as \$source) {
  48. \$config = array_merge(\$this->{\$source}, \$this->identities[\$db]);
  49. if (is_array(\$config['database'])) {
  50. \$config['database'] = \$config['database'][\$source];
  51. }
  52. if (!empty(\$config['schema']) && is_array(\$config['schema'])) {
  53. \$config['schema'] = \$config['schema'][\$source];
  54. }
  55. \$this->{\$source} = \$config;
  56. }
  57. }
  58. }" > app/Config/database.php
  59. - cd app
  60. script:
  61. - ../lib/Cake/Console/cake test Tools AllTools
  62. notifications:
  63. email: false