1st test in using local apache for testsuite
authorgggeek <giunta.gaetano@gmail.com>
Sun, 15 Mar 2015 22:16:33 +0000 (22:16 +0000)
committergggeek <giunta.gaetano@gmail.com>
Sun, 15 Mar 2015 22:16:33 +0000 (22:16 +0000)
.travis.yml
.travis/apache_vhost [new file with mode: 0644]

index 9e6531e..8d7f482 100644 (file)
@@ -13,13 +13,25 @@ install:
 
 before_script:
   # Disable xdebug. NB: this should NOT be done for hhvm...
-  - if [ $TRAVIS_PHP_VERSION != "hhvm" ]; then phpenv config-rm xdebug.ini; fi
+  - if [ $TRAVIS_PHP_VERSION != "hhvm" -a $TRAVIS_PHP_VERSION != "7.0" ]; then phpenv config-rm xdebug.ini; fi
 
   # TODO: we should set up an Apache instance inside the Travis VM and test it.
   # But it looks a bit complex, esp. as it seems that php has to be set up differently (cgi vs fpm) depending on version
   # So for now we just take an easy way out using a known remote server.
   # See: https://gist.github.com/roderik/3123962
   # See: http://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
+  - sudo apt-get install apache2 libapache2-mod-fastcgi
+
+  # enable php-fpm
+  - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
+  - sudo a2enmod rewrite actions fastcgi alias
+  - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
+  - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
+  # configure apache virtual hosts
+  - sudo cp -f .travis/apache_vhost /etc/apache2/sites-available/default
+  - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
+
+  - sudo service apache2 restart
 
 script:
-  phpunit tests LOCALSERVER=gggeek.altervista.org URI=/sw/xmlrpc/demo/server/server.php HTTPSSERVER=gggeek.ssl.altervista.org HTTPSURI=/sw/xmlrpc/demo/server/server.php NOPROXY=1
+  phpunit tests LOCALSERVER=localhost URI=/demo/server/server.php HTTPSSERVER=gggeek.ssl.altervista.org HTTPSURI=/sw/xmlrpc/demo/server/server.php NOPROXY=1
diff --git a/.travis/apache_vhost b/.travis/apache_vhost
new file mode 100644 (file)
index 0000000..26f70fe
--- /dev/null
@@ -0,0 +1,23 @@
+# Configuration file for Apache running on Travis.
+# PHP setup in FCGI mode
+
+<VirtualHost *:80>
+
+  DocumentRoot %TRAVIS_BUILD_DIR%
+
+  <Directory "%TRAVIS_BUILD_DIR%">
+    Options FollowSymLinks MultiViews ExecCGI
+    AllowOverride All
+    Order deny,allow
+    Allow from all
+  </Directory>
+
+  # Wire up Apache to use Travis CI's php-fpm.
+  <IfModule mod_fastcgi.c>
+    AddHandler php5-fcgi .php
+    Action php5-fcgi /php5-fcgi
+    Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
+    FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
+  </IfModule>
+
+</VirtualHost>
\ No newline at end of file