This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, 6.1 has been updated
       via  cdc15d1414b5ac7e56111852fea50b5d72676e55 (commit)
      from  7dd1ef928f895a99df500bce584dff3edce99757 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=cdc15d1414b5ac7e56111852fea50b5d72676e55

commit cdc15d1414b5ac7e56111852fea50b5d72676e55
Author: Roland Mas <[email protected]>
Date:   Mon Oct 30 20:10:29 2017 +0100

    Try working with a PHPUnit installed with Composer

diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index ea63e94..6a357e4 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -51,7 +51,10 @@ define('FORGE_OTHER_PASSWORD', 'toto_Tata8');
 $config = dirname(__FILE__).'/config.php';
 require_once $config;
 
-require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
+if ($phpunitversion == 4) {
+       require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
+       class PHPUnit_Extensions_SeleniumTestCase extends 
PHPUnit\Extensions\SeleniumTestCase {}
+}
 
 class FForge_SeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase
 {
diff --git a/tests/func_tests.php b/tests/func_tests.php
index b3b1c57..c68a264 100644
--- a/tests/func_tests.php
+++ b/tests/func_tests.php
@@ -3,7 +3,12 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
        define('PHPUnit_MAIN_METHOD', 'AllTests::main');
 }
 
-if (!@include_once 'PHPUnit/Autoload.php') {
+if (@include_once '/usr/share/php/vendor/autoload.php') {
+       $phpunitversion = 6;
+       class PHPUnit_Framework_TestSuite extends PHPUnit\Framework\TestSuite {}
+       class PHPUnit_Framework_TestCase extends PHPUnit\Framework\TestCase {}
+} elseif (!@include_once 'PHPUnit/Autoload.php') {
+       $phpunitversion = 4;
        include_once 'PHPUnit/Framework.php';
        require_once 'PHPUnit/TextUI/TestRunner.php';
 }
diff --git a/tests/func_tests.sh b/tests/func_tests.sh
index c10f932..29bbef9 100755
--- a/tests/func_tests.sh
+++ b/tests/func_tests.sh
@@ -71,7 +71,8 @@ install_selenium() {
                if grep -q ^8 /etc/debian_version; then
                    apt-get -y install phpunit phpunit-selenium patch psmisc 
patch rsyslog
                else
-                   apt-get -y install phpunit php-curl unzip composer patch 
psmisc patch rsyslog
+                   apt-get -y install php-curl unzip composer patch psmisc 
patch rsyslog
+                   composer --no-plugins --no-scripts require phpunit/phpunit
                    composer --no-plugins --no-scripts require 
phpunit/phpunit-selenium
                fi
        else
@@ -100,7 +101,8 @@ install_selenium() {
        grep -q "^$(hostname -i).*$(forge_get_config scm_host)" /etc/hosts || 
sed -i -e "s/^$(hostname -i).*/& $(forge_get_config scm_host)/" /etc/hosts
 
        # Fix screenshot default black background (/usr/share/{php,pear}) (fix 
available upstream)
-       patch -N /usr/share/*/PHPUnit/Extensions/SeleniumTestCase.php <<'EOF' 
|| true
+       if [ -e /usr/share/*/PHPUnit/Extensions/SeleniumTestCase.php ] ; then
+           patch -N /usr/share/*/PHPUnit/Extensions/SeleniumTestCase.php 
<<'EOF' || true
 --- /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php-dist        
2014-02-10 19:48:34.000000000 +0000
 +++ /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php     2014-09-01 
10:09:38.823051288 +0000
 @@ -1188,7 +1188,7 @@
@@ -113,6 +115,7 @@ install_selenium() {
              return 'Screenshot: ' . $this->screenshotUrl . '/' .
                     $this->testId . ".png\n";
 EOF
+       fi
 }
 
 # Mitigate testsuite timeouts, cf.
@@ -226,7 +229,13 @@ if [ -n "$1" ] ; then
        testname="$1"
 fi
 
-timeout 2h phpunit --verbose --debug --stop-on-failure --log-junit 
$SELENIUM_RC_DIR/phpunit-selenium.xml $testname || retcode=$?
+if [ -x /usr/share/php/vendor/bin/phpunit ] ; then
+    phpunit=/usr/share/php/vendor/bin/phpunit
+else
+    phpunit=phpunit
+fi
+
+timeout 2h $phpunit --verbose --debug --stop-on-failure --log-junit 
$SELENIUM_RC_DIR/phpunit-selenium.xml $testname || retcode=$?
 
 set +x
 echo "phpunit returned with code $retcode"

-----------------------------------------------------------------------

Summary of changes:
 tests/func/SeleniumForge.php |  5 ++++-
 tests/func_tests.php         |  7 ++++++-
 tests/func_tests.sh          | 15 ++++++++++++---
 3 files changed, 22 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to