Ver código fonte

Added PHP 5.6 and HHVM to Travis

Martin Hujer 12 anos atrás
pai
commit
7f20cd2a5b
5 arquivos alterados com 48 adições e 21 exclusões
  1. 1 0
      .gitignore
  2. 12 6
      .travis.yml
  3. 4 0
      composer.json
  4. 22 15
      tests/install_dependencies.sh
  5. 9 0
      tests/runalltests.php

+ 1 - 0
.gitignore

@@ -6,3 +6,4 @@ tests/Zend/OpenId/Provider/Storage/_files/*
 tests/Zend/OpenId/_files/*
 tests/Zend/Translate/Adapter/_files/zend_cache---internal-metadatas---testid
 tests/Zend/Translate/Adapter/_files/zend_cache---testid
+vendor/*

+ 12 - 6
.travis.yml

@@ -1,17 +1,23 @@
 language: php
+
 php:
-  - "5.2"
-  - "5.3"
-  - "5.4"
-  - "5.5"
+  - 5.2
+  - 5.3
+  - 5.4
+  - 5.5
+  - 5.6
+  - hhvm
 
 env: TMPDIR=/tmp
 
-before_install:
- - phpenv rehash
+install:
  - sh ./tests/install_dependencies.sh
  - phpenv rehash
 
 script:
  - cd tests/
  - php runalltests.php
+ 
+matrix:
+  allow_failures:
+   - php: hhvm

+ 4 - 0
composer.json

@@ -26,5 +26,9 @@
         "branch-alias": {
             "dev-master": "1.12.x-dev"
         }
+    },
+    "require-dev": {
+        "phpunit/phpunit": "3.7.*",
+        "phpunit/dbunit": "1.3.*"
     }
 }

+ 22 - 15
tests/install_dependencies.sh

@@ -1,20 +1,27 @@
 #!/bin/sh
 
-# To install DbUnit, we have to install everything
+echo $TRAVIS_PHP_VERSION;
 
-pear channel-discover pear.phpunit.de
-pear channel-discover pear.symfony-project.com
-pear update-channels
+if [ "$TRAVIS_PHP_VERSION" = "5.2" ]; then
+    # To install DbUnit, we have to install everything
+    pear channel-discover pear.phpunit.de
+    pear channel-discover pear.symfony-project.com
+    pear update-channels
+
+    # remove any existing phpunit packages
+    pear uninstall -n pear.phpunit.de/PHPUnit
+    pear uninstall -n pear.phpunit.de/PHP_CodeCoverage
+    pear uninstall -n pear.phpunit.de/PHPUnit_MockObject
+    pear uninstall -n pear.phpunit.de/File_Iterator
+    pear uninstall -n pear.phpunit.de/Text_Template
+    pear uninstall -n pear.phpunit.de/PHP_Timer
+    pear uninstall -n pear.symfony-project.com/YAML
+
+    # Install
+    pear install -o pear.phpunit.de/PHPUnit
+    pear install pear.phpunit.de/DbUnit
+else
+    composer install --no-interaction --prefer-source --dev
+fi
 
-# remove any existing phpunit packages
-pear uninstall -n pear.phpunit.de/PHPUnit
-pear uninstall -n pear.phpunit.de/PHP_CodeCoverage
-pear uninstall -n pear.phpunit.de/PHPUnit_MockObject
-pear uninstall -n pear.phpunit.de/File_Iterator
-pear uninstall -n pear.phpunit.de/Text_Template
-pear uninstall -n pear.phpunit.de/PHP_Timer
-pear uninstall -n pear.symfony-project.com/YAML
 
-# Install
-pear install -o pear.phpunit.de/PHPUnit
-pear install pear.phpunit.de/DbUnit

+ 9 - 0
tests/runalltests.php

@@ -43,6 +43,10 @@ if (!is_executable($PHPUNIT)) {
     echo "PHPUnit is not executable ($PHPUNIT)";
 }
 
+if ($_SERVER['TRAVIS_PHP_VERSION'] != '5.2') {
+    $PHPUNIT = '../bin/phpunit'; //PHPUnit from composer
+}
+
 // locate all tests
 $files = glob('{Zend/*/AllTests.php,Zend/*Test.php}', GLOB_BRACE);
 sort($files);
@@ -52,6 +56,11 @@ $result = 0;
 
 // run through phpunit
 while(list(, $file)=each($files)) {
+    if ($_SERVER['TRAVIS_PHP_VERSION'] == 'hhvm' && $file == 'Zend/CodeGenerator/AllTests.php') {
+        echo "Skipping $file on HHVM" . PHP_EOL; //gets stuck on the HHVM
+        continue;
+    }
+
     echo "Executing {$file}" . PHP_EOL;
     system($PHPUNIT . ' --stderr -d memory_limit=-1 -d error_reporting=E_ALL\&E_STRICT -d display_errors=1 ' . escapeshellarg($file), $c_result);
     echo PHP_EOL;