Skip to content

Commit

Permalink
fix: move tests to phpBB 3.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertHeim committed Jun 27, 2020
1 parent c5e2d34 commit c56cad5
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 83 deletions.
64 changes: 31 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,60 @@
language: php
sudo: required
dist: xenial

matrix:
include:
- php: 5.4
env: DB=mysqli
- php: 5.4
env: DB=mysql
- php: 5.4
- php: 7.1
env: DB=none;NOTESTS=1
- php: 7.1
env: DB=mariadb
- php: 5.4
- php: 7.1
env: DB=postgres
- php: 5.4
- php: 7.1
env: DB=sqlite3
- php: 5.5
- php: 7.1
env: DB=mysqli # MyISAM
- php: 7.2
env: DB=mysqli
- php: 5.6
- php: 7.3
env: DB=mysqli
- php: 7.0
- php: 7.4snapshot
env: DB=mysqli
- php: hhvm
- php: nightly
env: DB=mysqli
allow_failures:
- php: hhvm
- php: nightly
fast_finish: true

env:
global:
- EXTNAME="robertheim/topictags" # CHANGE name of the extension HERE
- SNIFF="1" # Should we run code sniffer on your code?
- IMAGE_ICC="1" # Should we run icc profile sniffer on your images?
- COVERAGE="1" # Should we send coverage?
- EPV="1" # Should we run EPV (Extension Pre Validator) on your code?
- PHPBB_BRANCH="3.2.x"
- EXTNAME="robertheim/topictags" # CHANGE name of the extension HERE
- SNIFF="1" # Should we run code sniffer on your code?
- IMAGE_ICC="1" # Should we run icc profile sniffer on your images?
- EPV="1" # Should we run EPV (Extension Pre Validator) on your code?
- PHPBB_BRANCH="3.3.x"

branches:
only:
- master
- /^(3\.[1-9]|[4-9]\.\d)\.x$/
- /^\d+(\.\d+)?\.x$/

services:
- postgresql
- mysql

install:
- composer install --dev --no-interaction --prefer-source
- travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH
- travis/prepare-phpbb.sh $PHPBB_BRANCH
- cd ../../phpBB3
- travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH
- travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION
- sh -c "if [ '$COVERAGE' != '0' ]; then ../RobertHeim/phpbb-ext-topictags/travis/prepare-coverage.sh $DB $TRAVIS_PHP_VERSION; fi"
- travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION $NOTESTS
- ../RobertHeim/phpbb-ext-topictags/travis/prepare-epv.sh $EPV $NOTESTS

before_script:
- travis/setup-database.sh $DB $TRAVIS_PHP_VERSION
- mkdir build/logs
- chmod +wx build/logs
- travis/setup-database.sh $DB $TRAVIS_PHP_VERSION $NOTESTS

script:
- sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME; fi"
- sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION; fi"
- ../RobertHeim/phpbb-ext-topictags/travis/run-testsuite.sh $DB $TRAVIS_PHP_VERSION
- sh -c "if [ '$EPV' != '0' ] && [ '$TRAVIS_PHP_VERSION' = '5.3.3' ] && [ '$DB' = 'mysqli' ]; then phpBB/ext/$EXTNAME/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"
- sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME $NOTESTS; fi"
- sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION $NOTESTS; fi"
- sh -c "if [ '$EPV' != '0' -a '$NOTESTS' = '1' ]; then phpBB/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"
- sh -c "if [ '$NOTESTS' != '1' ]; then phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php; fi"

after_script:
- sh -c "if [ '$COVERAGE' != '0' ]; then ../RobertHeim/phpbb-ext-topictags/travis/upload-coverage.sh $DB $TRAVIS_PHP_VERSION; fi"
6 changes: 1 addition & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
verbose="true"
bootstrap="../../../../tests/bootstrap.php"
>
Expand All @@ -18,14 +17,11 @@
<exclude>./tests/functional</exclude>
</testsuite>
<testsuite name="Extension Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">./tests/functional/</directory>
<directory suffix="_test.php">./tests/functional/</directory>
</testsuite>
</testsuites>

<filter>
<blacklist>
<directory>./tests/</directory>
</blacklist>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./</directory>
<exclude>
Expand Down
13 changes: 0 additions & 13 deletions travis/prepare-coverage.sh

This file was deleted.

23 changes: 23 additions & 0 deletions travis/prepare-epv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
#
# This file is part of the phpBB Forum Software package.
#
# @copyright (c) phpBB Limited <https://www.phpbb.com>
# @license GNU General Public License, version 2 (GPL-2.0)
#
# For full copyright and license information, please see
# the docs/CREDITS.txt file.
#
set -e
set -x

EPV=$1
NOTESTS=$2

if [ "$EPV" == "1" ] && [ "$NOTESTS" == "1" ]
then
cd phpBB
composer remove sami/sami --update-with-dependencies --dev --no-interaction
composer require phpbb/epv:dev-master --dev --no-interaction --ignore-platform-reqs
cd ../
fi
6 changes: 2 additions & 4 deletions travis/prepare-phpbb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
set -e
set -x

EXTNAME=$1
BRANCH=$2
EXTPATH_TEMP=$3
BRANCH=$1

# Copy extension to a temp folder
mkdir ../../tmp
cp -R . ../../tmp
cd ../../

# Clone phpBB
git clone --depth=1 "git://github.com/phpbb/phpbb.git" "phpBB3" --branch=$BRANCH
git clone --depth=1 "git://github.com/phpbb/phpbb.git" "phpBB3" --branch="$BRANCH"
14 changes: 0 additions & 14 deletions travis/run-testsuite.sh

This file was deleted.

14 changes: 0 additions & 14 deletions travis/upload-coverage.sh

This file was deleted.

0 comments on commit c56cad5

Please sign in to comment.