From ac6896d6e0ae1622300cdeb72ff6287ba7f82a52 Mon Sep 17 00:00:00 2001 From: "Kailey M. Snay" Date: Thu, 3 Sep 2026 18:21:07 -0400 Subject: [PATCH 1/2] Update to phpBB's testing framework --- .github/workflows/tests.yml | 83 +++++++++++++++++++++++++++++++++++++ .travis.yml | 67 ------------------------------ phpunit.xml.dist | 38 ----------------- travis/prepare-epv.sh | 23 ---------- travis/prepare-phpbb.sh | 24 ----------- 5 files changed, 83 insertions(+), 152 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml delete mode 100644 phpunit.xml.dist delete mode 100755 travis/prepare-epv.sh delete mode 100755 travis/prepare-phpbb.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..32cf3a3 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,83 @@ +name: Tests + +# For most extensions, this workflow should not need changing; +# simply commit it to your repository. +# +# See the README for full details and configuration instructions: +# - https://github.com/phpbb-extensions/test-framework +# +on: + push: + # Run tests when commits are pushed to these branches in your repo, + # or remove this branches section to run tests on all your branches + branches: + - master # Legacy or alternative main branch + + pull_request: + # Run tests when pull requests are made on these branches in your repo, + # or remove this branches section to run tests on all your branches + branches: + - master + +jobs: + call-tests: + name: Extension tests + uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x + with: + EXTNAME: phpbbmodders/banhammer # Your extension vendor/package name (required) + + # OPTIONAL CONFIGURATIONS BELOW + # The following arguments are optional and can be omitted if not needed. + + # The phpBB repository's branch to use when running tests. + # Default is '3.3.x', which this framework is designed for. + # If using a different branch, ensure it's compatible with 3.3.x. + # To test with phpBB's master branch, refer to the phpBB Branches section of this README. + # Default: '3.3.x' + PHPBB_BRANCH: '3.3.x' + + # Run phpBB's EPV (Extension Pre Validator)? 1 (yes) or 0 (no) + EPV: 1 + + # Check for files with executable permissions? 1 (yes) or 0 (no) + EXECUTABLE_FILES: 1 + + # Remove embedded ICC profiles from images? 1 (yes) or 0 (no) + IMAGE_ICC: 1 + + # Run CodeSniffer to detect PHP code style issues? 1 (yes) or 0 (no) + SNIFF: 1 + + # Run MySQL/MariaDB tests? 1 (yes) or 0 (no) + RUN_MYSQL_JOBS: 0 + + # Run PostgreSQL tests? 1 (yes) or 0 (no) + RUN_PGSQL_JOBS: 0 + + # Run MSSQL and SQLite3 tests? 1 (yes) or 0 (no) + RUN_MSSQL_JOBS: 0 + + # Run Windows IIS & PostgreSQL tests? 1 (yes) or 0 (no) + RUN_WINDOWS_JOBS: 0 + + # Run functional tests if you have them? 1 (yes) or 0 (no) + RUN_FUNCTIONAL_TESTS: 0 + + # Install npm dependencies (if your extension relies on them)? 1 (yes) or 0 (no) + RUN_NPM_INSTALL: 0 + + # Install Composer dependencies (if your extension relies on them)? 1 (yes) or 0 (no) + RUN_COMPOSER_INSTALL: 0 + + # CUSTOMISE PHP VERSIONS + # To override the default PHP versions tested (7.2 through 8.4): + + # Preferred PHP version used for all test jobs. + PRIMARY_PHP_VERSION: '7.4' + + # The MySQL and PostgreSQL jobs run tests across multiple PHP versions. + # List the PHP versions you want your extension tested with. + PHP_VERSION_MATRIX: '["7.4", "8.0", "8.1","8.2", "8.3", "8.4"]' + + # Generate a code coverage report (see documentation below)? 1 (yes) or 0 (no) + CODECOV: 0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 41ff0c7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Opt into fully virtualized infrastructure -sudo: required -dist: precise - -language: php - -matrix: - include: - - php: 5.5 - env: DB=none;NOTESTS=1 - - php: 5.4 - env: DB=mysqli #myisam - - php: 5.4 - env: DB=mysql - - php: 5.4 - env: DB=mariadb - - php: 5.4 - env: DB=postgres - - php: 5.4 - env: DB=sqlite3 - - php: 5.5 - env: DB=mysqli - - php: 5.6 - env: DB=mysqli - - php: 7.0 - env: DB=mysqli - - php: 7.1 - env: DB=mysqli - - php: nightly - env: DB=mysqli - - php: hhvm - env: DB=mysqli - allow_failures: - - php: nightly - - php: hhvm -fast_finish: true - -env: - global: - - EXTNAME="phpbbmodders/ban-hammer" # CHANGE name of the extension HERE - - SNIFF="1" # Should we run code sniffer on your code? - - IMAGE_ICC="0" # Should we run icc profile sniffer on your images? - - EPV="1" # Should we run EPV (Extension Pre Validator) on your code? - - PHPBB_BRANCH="3.2.x" - -branches: - only: - - master - - develop - - /^develop-.*$/ - - /^\d+(\.\d+)?\.x$/ - -install: - - travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH - - cd ../../phpBB3 - - travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH - - travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION $NOTESTS - - ../phpbbmodders/ban-hammer/travis/prepare-epv.sh $EPV $NOTESTS - -before_script: - - 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 $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' ] && [ '$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" diff --git a/phpunit.xml.dist b/phpunit.xml.dist deleted file mode 100644 index 289449d..0000000 --- a/phpunit.xml.dist +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - ./tests - ./tests/functional - - - ./tests/functional/ - - - - - - ./tests/ - - - ./ - - ./language/ - ./migrations/ - ./tests/ - - - - diff --git a/travis/prepare-epv.sh b/travis/prepare-epv.sh deleted file mode 100755 index 51e91a8..0000000 --- a/travis/prepare-epv.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# -# This file is part of the phpBB Forum Software package. -# -# @copyright (c) phpBB Limited -# @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" -a "$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 diff --git a/travis/prepare-phpbb.sh b/travis/prepare-phpbb.sh deleted file mode 100755 index 01770ad..0000000 --- a/travis/prepare-phpbb.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -# This file is part of the phpBB Forum Software package. -# -# @copyright (c) phpBB Limited -# @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 - -EXTNAME=$1 -BRANCH=$2 -EXTPATH_TEMP=$3 - -# 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 From 8503f96f27856074c05acc4925eae5e4dff75ede Mon Sep 17 00:00:00 2001 From: "Kailey M. Snay" Date: Thu, 3 Sep 2026 19:05:38 -0400 Subject: [PATCH 2/2] Update build badge --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7985978..2381532 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,11 @@ Ban Hammer for phpBB 3.3.x line (was One Click Ban) Gives possibility to ban users directly from their profile. Along with banning you can automatically move the user to a certain group, delete their posts, delete their private messages, delete their avatar, signature, and profile information. -[![Build Status](https://travis-ci.org/phpbbmodders/ban-hammer.svg?branch=master)](https://travis-ci.org/phpbbmodders/ban-hammer) +## Automated testing + +We use automated unit tests to prevent regressions. Check out our build below: + +[![Tests](https://github.com/phpbbmodders/ban-hammer/actions/workflows/tests.yml/badge.svg)](https://github.com/phpbbmodders/ban-hammer/actions/workflows/tests.yml) ## Acknowledgments