Просмотр исходного кода

Merge pull request #482 from mhujer/471-phpunit-phar

Stop using PEAR version of PHPUnit. Use git cloning instead.
Frank Brückner 11 лет назад
Родитель
Сommit
d1c9d299ca
3 измененных файлов с 43 добавлено и 14 удалено
  1. 1 1
      tests/Zend/Filter/Compress/TarTest.php
  2. 38 12
      tests/php52_install_dependencies.sh
  3. 4 1
      tests/runalltests.php

+ 1 - 1
tests/Zend/Filter/Compress/TarTest.php

@@ -55,7 +55,7 @@ class Zend_Filter_Compress_TarTest extends PHPUnit_Framework_TestCase
         if (!class_exists('Archive_Tar')) {
             require_once 'Zend/Loader.php';
             try {
-                Zend_Loader::loadClass('Archive_Tar');
+                @Zend_Loader::loadClass('Archive_Tar');
             } catch (Zend_Exception $e) {
                 $this->markTestSkipped('This filter needs PEARs Archive_Tar');
             }

+ 38 - 12
tests/php52_install_dependencies.sh

@@ -1,10 +1,5 @@
 #!/bin/sh
 
-# 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
@@ -12,7 +7,44 @@ 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 PHPUnit from git (only possibility for PHPUnit 3.6)
+cd tests
+mkdir phpunit && cd phpunit
+git clone git://github.com/sebastianbergmann/phpunit.git
+git clone git://github.com/sebastianbergmann/dbunit.git
+git clone git://github.com/sebastianbergmann/php-file-iterator.git
+git clone git://github.com/sebastianbergmann/php-text-template.git
+git clone git://github.com/sebastianbergmann/php-code-coverage.git
+git clone git://github.com/sebastianbergmann/php-token-stream.git
+git clone git://github.com/sebastianbergmann/php-timer.git
+git clone git://github.com/sebastianbergmann/phpunit-mock-objects.git
+git clone git://github.com/sebastianbergmann/phpunit-selenium.git
+git clone git://github.com/sebastianbergmann/phpunit-story.git
+git clone git://github.com/sebastianbergmann/php-invoker.git
+
+# last versions without anonymous functions
+cd dbunit && git checkout 1.1 && cd ..
+cd php-code-coverage && git checkout 1.1 && cd ..
+cd php-file-iterator && git checkout 1.3.2 && cd ..
+cd php-invoker && git checkout 1.1.1 && cd ..
+cd php-text-template && git checkout 1.1.2 && cd ..
+cd php-timer && git checkout 1.0.3 && cd ..
+cd php-token-stream && git checkout 1.1.4 && cd ..
+cd phpunit && git checkout 3.6.12 && cd ..
+cd phpunit-mock-objects && git checkout 1.1 && cd ..
+cd phpunit-selenium && git checkout 1.1 && cd ..
+cd phpunit-story && git checkout 1.0.0 && cd ..
+
+sed -i 's/@package_version@/3.6.12/g' phpunit/PHPUnit/Runner/Version.php
+cat phpunit/PHPUnit/Runner/Version.php
+
+cd phpunit
+
+php -d include_path='.:../phpunit/:../dbunit/:../php-code-coverage/:../php-file-iterator/:../php-invoker/:../php-text-template/:../php-timer:../php-token-stream:../phpunit-mock-objects/:../phpunit-selenium/:../phpunit-story/:/usr/local/lib/php' ../phpunit/phpunit.php --version
+
+cd ..
+cd ..
 
 # memcache 2.1.0 is the last version to support the php 5.2 branch
 pecl download memcached-2.1.0
@@ -23,9 +55,3 @@ printf "\n" | phpize
 
 printf "\n" | pecl uninstall memcache
 printf "\n" | pecl install memcache
-
-# Install
-pear install -o pear.phpunit.de/PHPUnit
-pear install pear.phpunit.de/DbUnit
-
-

+ 4 - 1
tests/runalltests.php

@@ -43,7 +43,10 @@ if (!is_executable($PHPUNIT)) {
     echo "PHPUnit is not executable ($PHPUNIT)";
 }
 
-if ($_SERVER['TRAVIS_PHP_VERSION'] != '5.2') {
+if ($_SERVER['TRAVIS_PHP_VERSION'] == '5.2') {
+    //PHPUnit from git clone
+    $PHPUNIT = 'php -d include_path=\'.:./phpunit/phpunit/:./phpunit/dbunit/:./phpunit/php-code-coverage/:./phpunit/php-file-iterator/:./phpunit/php-invoker/:./phpunit/php-text-template/:./phpunit/php-timer:./phpunit/php-token-stream:./phpunit/phpunit-mock-objects/:./phpunit/phpunit-selenium/:./phpunit/phpunit-story/:/usr/local/lib/php\' ./phpunit/phpunit/phpunit.php';
+} else {
     $PHPUNIT = '../bin/phpunit'; //PHPUnit from composer
 }