diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fb2003d7..c9ea6513 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,71 +22,71 @@ on: jobs: # START Basic Checks Job (EPV, code sniffer, images check, etc.) - basic-checks: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - db: 'none' - php: '8.1' - NOTESTS: 1 - - name: PHP ${{ matrix.php }} - ${{ matrix.db }} - - steps: - - name: Checkout phpBB - uses: actions/checkout@v3 - with: - repository: phpbb/phpbb - ref: ${{ env.PHPBB_BRANCH }} - path: phpBB3 - - - name: Checkout extension - uses: actions/checkout@v3 - with: - path: phpBB3/phpBB/ext/${{ env.EXTNAME }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv - coverage: none - - - name: Setup environment for phpBB - env: - DB: ${{ matrix.db }} - PHP_VERSION: ${{ matrix.php }} - NOTESTS: '1' - run: .github/setup-phpbb.sh $DB $PHP_VERSION $NOTESTS - working-directory: ./phpBB3 - - - name: Setup EPV - if: ${{ env.EPV != 0 }} - run: composer require phpbb/epv:dev-master --dev --no-interaction --ignore-platform-reqs - working-directory: ./phpBB3/phpBB - - - name: Run code sniffer - if: ${{ env.SNIFF != 0 }} - env: - NOTESTS: '1' - run: .github/ext-sniff.sh $EXTNAME $NOTESTS - working-directory: ./phpBB3 - - - name: Check image ICC profiles - if: ${{ env.IMAGE_ICC != 0 }} - run: .github/check-image-icc-profiles.sh - working-directory: ./phpBB3 - - - name: Check executable files - if: ${{ env.EXECUTABLE_FILES != 0 }} - run: .github/ext-check-executable-files.sh ./ $EXTNAME - working-directory: ./phpBB3 - - - name: Run EPV - if: ${{ env.EPV != 0 }} - run: phpBB/vendor/bin/EPV.php run --dir="phpBB/ext/$EXTNAME/" - working-directory: ./phpBB3 +# basic-checks: +# runs-on: ubuntu-latest +# strategy: +# matrix: +# include: +# - db: 'none' +# php: '8.1' +# NOTESTS: 1 +# +# name: PHP ${{ matrix.php }} - ${{ matrix.db }} +# +# steps: +# - name: Checkout phpBB +# uses: actions/checkout@v3 +# with: +# repository: phpbb/phpbb +# ref: ${{ env.PHPBB_BRANCH }} +# path: phpBB3 +# +# - name: Checkout extension +# uses: actions/checkout@v3 +# with: +# path: phpBB3/phpBB/ext/${{ env.EXTNAME }} +# +# - name: Setup PHP +# uses: shivammathur/setup-php@v2 +# with: +# php-version: ${{ matrix.php }} +# extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv +# coverage: none +# +# - name: Setup environment for phpBB +# env: +# DB: ${{ matrix.db }} +# PHP_VERSION: ${{ matrix.php }} +# NOTESTS: '1' +# run: .github/setup-phpbb.sh $DB $PHP_VERSION $NOTESTS +# working-directory: ./phpBB3 +# +# - name: Setup EPV +# if: ${{ env.EPV != 0 }} +# run: composer require phpbb/epv:dev-master --dev --no-interaction --ignore-platform-reqs +# working-directory: ./phpBB3/phpBB +# +# - name: Run code sniffer +# if: ${{ env.SNIFF != 0 }} +# env: +# NOTESTS: '1' +# run: .github/ext-sniff.sh $EXTNAME $NOTESTS +# working-directory: ./phpBB3 +# +# - name: Check image ICC profiles +# if: ${{ env.IMAGE_ICC != 0 }} +# run: .github/check-image-icc-profiles.sh +# working-directory: ./phpBB3 +# +# - name: Check executable files +# if: ${{ env.EXECUTABLE_FILES != 0 }} +# run: .github/ext-check-executable-files.sh ./ $EXTNAME +# working-directory: ./phpBB3 +# +# - name: Run EPV +# if: ${{ env.EPV != 0 }} +# run: phpBB/vendor/bin/EPV.php run --dir="phpBB/ext/$EXTNAME/" +# working-directory: ./phpBB3 # END Basic Checks Job # START MySQL and MariaDB Job @@ -95,38 +95,38 @@ jobs: strategy: matrix: include: - - php: '8.1' - db: "mariadb:10.2" - - php: '8.1' - db: "mariadb:10.3" - - php: '8.1' - db: "mariadb:10.4" - - php: '8.1' - db: "mariadb:10.6" - - php: '8.1' - db: "mariadb:10.9" - - php: '8.1' - db: "mariadb:10.10" - - php: '8.1' - db: "mariadb:10.11" - - php: '8.1' - db: "mysql:5.7" - db_alias: "MyISAM Tests" - MYISAM: 1 - - php: '8.1' - db: "mysql:5.7" - COVERAGE: 0 -# db_alias: "mysql:5.7 with Coverage" - - php: '8.1' - db: "mysql:8.0" - - php: '8.1' - db: "mysql:8.1" - - php: '8.2' - db: "mysql:8.0" - - php: '8.2' - db: "mariadb:10.2" -# - php: '8.3' +# - php: '8.1' +# db: "mariadb:10.2" +# - php: '8.1' +# db: "mariadb:10.3" +# - php: '8.1' +# db: "mariadb:10.4" +# - php: '8.1' +# db: "mariadb:10.6" +# - php: '8.1' +# db: "mariadb:10.9" +# - php: '8.1' +# db: "mariadb:10.10" +# - php: '8.1' +# db: "mariadb:10.11" +# - php: '8.1' # db: "mysql:5.7" +# db_alias: "MyISAM Tests" +# MYISAM: 1 +# - php: '8.1' +# db: "mysql:5.7" +# COVERAGE: 0 +## db_alias: "mysql:5.7 with Coverage" +# - php: '8.1' +# db: "mysql:8.0" +# - php: '8.1' +# db: "mysql:8.1" +# - php: '8.2' +# db: "mysql:8.0" +# - php: '8.2' +# db: "mariadb:10.2" + - php: '8.3' + db: "mysql:5.7" # - php: '8.3' # db: "mariadb:10.2" @@ -241,212 +241,212 @@ jobs: # END MySQL and MariaDB Job # START PostgreSQL Job - postgres-tests: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - php: '8.1' - db: "postgres:9.5" - - php: '8.1' - db: "postgres:9.6" - - php: '8.1' - db: "postgres:10" - - php: '8.1' - db: "postgres:11" - - php: '8.1' - db: "postgres:12" - - php: '8.1' - db: "postgres:13" - - php: '8.1' - db: "postgres:14" - - php: '8.1' - db: "postgres:15" - - php: '8.2' - db: "postgres:9.5" -# - php: '8.3' +# postgres-tests: +# runs-on: ubuntu-latest +# strategy: +# matrix: +# include: +# - php: '8.1' # db: "postgres:9.5" - - name: PHP ${{ matrix.php }} - ${{ matrix.db }} - - services: - postgres: - image: ${{ matrix.db != 'postgres:9.5' && matrix.db != 'postgres:9.6' && matrix.db != 'postgres:10' && matrix.db != 'postgres:11' && matrix.db != 'postgres:12' && matrix.db != 'postgres:13' && matrix.db != 'postgres:14' && matrix.db != 'postgres:15' && 'postgres:10' || matrix.db }} - env: - POSTGRES_HOST: localhost - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - ports: - - 5432:5432 - options: >- - -v /var/run/postgresql:/var/run/postgresql - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 6379:6379 - - steps: - - name: Checkout phpBB - uses: actions/checkout@v3 - with: - repository: phpbb/phpbb - ref: ${{ env.PHPBB_BRANCH }} - path: phpBB3 - - - name: Checkout extension - uses: actions/checkout@v3 - with: - path: phpBB3/phpBB/ext/${{ env.EXTNAME }} - - - id: database-type - env: - MATRIX_DB: ${{ matrix.db }} - run: | - db=$(echo "${MATRIX_DB%%:*}") - echo "db=$db" >> $GITHUB_OUTPUT - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, pgsql, pdo, pdo_pgsql - coverage: none - - - name: Setup environment for phpBB - env: - DB: ${{steps.database-type.outputs.db}} - PHP_VERSION: ${{ matrix.php }} - NOTESTS: '0' - run: .github/setup-phpbb.sh $DB $PHP_VERSION ${NOTESTS:-0} - working-directory: ./phpBB3 - - - name: Setup database - env: - DB: ${{steps.database-type.outputs.db}} - MYISAM: '0' - run: .github/setup-database.sh $DB $MYISAM - working-directory: ./phpBB3 - - - name: Setup PHPUnit files - run: mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_ - working-directory: ./phpBB3 - - - name: Run unit tests - env: - DB: ${{steps.database-type.outputs.db}} - run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php - working-directory: ./phpBB3 +# - php: '8.1' +# db: "postgres:9.6" +# - php: '8.1' +# db: "postgres:10" +# - php: '8.1' +# db: "postgres:11" +# - php: '8.1' +# db: "postgres:12" +# - php: '8.1' +# db: "postgres:13" +# - php: '8.1' +# db: "postgres:14" +# - php: '8.1' +# db: "postgres:15" +# - php: '8.2' +# db: "postgres:9.5" +## - php: '8.3' +## db: "postgres:9.5" +# +# name: PHP ${{ matrix.php }} - ${{ matrix.db }} +# +# services: +# postgres: +# image: ${{ matrix.db != 'postgres:9.5' && matrix.db != 'postgres:9.6' && matrix.db != 'postgres:10' && matrix.db != 'postgres:11' && matrix.db != 'postgres:12' && matrix.db != 'postgres:13' && matrix.db != 'postgres:14' && matrix.db != 'postgres:15' && 'postgres:10' || matrix.db }} +# env: +# POSTGRES_HOST: localhost +# POSTGRES_USER: postgres +# POSTGRES_PASSWORD: postgres +# ports: +# - 5432:5432 +# options: >- +# -v /var/run/postgresql:/var/run/postgresql +# --health-cmd pg_isready +# --health-interval 10s +# --health-timeout 5s +# --health-retries 5 +# +# redis: +# image: redis +# options: >- +# --health-cmd "redis-cli ping" +# --health-interval 10s +# --health-timeout 5s +# --health-retries 5 +# ports: +# - 6379:6379 +# +# steps: +# - name: Checkout phpBB +# uses: actions/checkout@v3 +# with: +# repository: phpbb/phpbb +# ref: ${{ env.PHPBB_BRANCH }} +# path: phpBB3 +# +# - name: Checkout extension +# uses: actions/checkout@v3 +# with: +# path: phpBB3/phpBB/ext/${{ env.EXTNAME }} +# +# - id: database-type +# env: +# MATRIX_DB: ${{ matrix.db }} +# run: | +# db=$(echo "${MATRIX_DB%%:*}") +# echo "db=$db" >> $GITHUB_OUTPUT +# +# - name: Setup PHP +# uses: shivammathur/setup-php@v2 +# with: +# php-version: ${{ matrix.php }} +# extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, pgsql, pdo, pdo_pgsql +# coverage: none +# +# - name: Setup environment for phpBB +# env: +# DB: ${{steps.database-type.outputs.db}} +# PHP_VERSION: ${{ matrix.php }} +# NOTESTS: '0' +# run: .github/setup-phpbb.sh $DB $PHP_VERSION ${NOTESTS:-0} +# working-directory: ./phpBB3 +# +# - name: Setup database +# env: +# DB: ${{steps.database-type.outputs.db}} +# MYISAM: '0' +# run: .github/setup-database.sh $DB $MYISAM +# working-directory: ./phpBB3 +# +# - name: Setup PHPUnit files +# run: mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_ +# working-directory: ./phpBB3 +# +# - name: Run unit tests +# env: +# DB: ${{steps.database-type.outputs.db}} +# run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php +# working-directory: ./phpBB3 # END PostgreSQL Job # START Other Tests Job (SQLite 3 and mssql) - other-tests: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - php: '8.1' - db: "sqlite3" - - php: '8.1' - db: "mcr.microsoft.com/mssql/server:2017-latest" - db_alias: 'MSSQL 2017' - - php: '8.1' - db: "mcr.microsoft.com/mssql/server:2019-latest" - db_alias: 'MSSQL 2019' - - php: '8.1' - db: "mcr.microsoft.com/mssql/server:2022-latest" - db_alias: 'MSSQL 2022' - - name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} - - services: - mssql: - image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2022-latest' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }} - env: - SA_PASSWORD: "Pssw0rd_12" - ACCEPT_EULA: "y" - ports: - - 1433:1433 - options: >- - --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Pssw0rd_12' -Q \"Use [master]; CREATE DATABASE [phpbb_tests] COLLATE Latin1_General_CI_AS\" || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - --health-start-period 10s - - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 6379:6379 - - steps: - - name: Checkout phpBB - uses: actions/checkout@v3 - with: - repository: phpbb/phpbb - ref: ${{ env.PHPBB_BRANCH }} - path: phpBB3 - - - name: Checkout extension - uses: actions/checkout@v3 - with: - path: phpBB3/phpBB/ext/${{ env.EXTNAME }} - - - id: database-type - env: - MATRIX_DB: ${{ matrix.db }} - run: | - if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-latest' ] - then - db='mssql' - else - db=$(echo "${MATRIX_DB%%:*}") - fi - echo "db=$db" >> $GITHUB_OUTPUT - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, sqlsrv, pdo, pdo_sqlsrv - coverage: none - - - name: Setup environment for phpBB - env: - DB: ${{steps.database-type.outputs.db}} - PHP_VERSION: ${{ matrix.php }} - NOTESTS: '0' - run: .github/setup-phpbb.sh $DB $PHP_VERSION ${NOTESTS:-0} - working-directory: ./phpBB3 - - - name: Setup database - env: - DB: ${{steps.database-type.outputs.db}} - MYISAM: '0' - run: .github/setup-database.sh $DB $MYISAM - working-directory: ./phpBB3 - - - name: Setup PHPUnit files - run: mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_ - working-directory: ./phpBB3 - - - name: Run unit tests - env: - DB: ${{steps.database-type.outputs.db}} - run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php - working-directory: ./phpBB3 +# other-tests: +# runs-on: ubuntu-latest +# strategy: +# matrix: +# include: +# - php: '8.1' +# db: "sqlite3" +# - php: '8.1' +# db: "mcr.microsoft.com/mssql/server:2017-latest" +# db_alias: 'MSSQL 2017' +# - php: '8.1' +# db: "mcr.microsoft.com/mssql/server:2019-latest" +# db_alias: 'MSSQL 2019' +# - php: '8.1' +# db: "mcr.microsoft.com/mssql/server:2022-latest" +# db_alias: 'MSSQL 2022' +# +# name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} +# +# services: +# mssql: +# image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2022-latest' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }} +# env: +# SA_PASSWORD: "Pssw0rd_12" +# ACCEPT_EULA: "y" +# ports: +# - 1433:1433 +# options: >- +# --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Pssw0rd_12' -Q \"Use [master]; CREATE DATABASE [phpbb_tests] COLLATE Latin1_General_CI_AS\" || exit 1" +# --health-interval 10s +# --health-timeout 5s +# --health-retries 5 +# --health-start-period 10s +# +# redis: +# image: redis +# options: >- +# --health-cmd "redis-cli ping" +# --health-interval 10s +# --health-timeout 5s +# --health-retries 5 +# ports: +# - 6379:6379 +# +# steps: +# - name: Checkout phpBB +# uses: actions/checkout@v3 +# with: +# repository: phpbb/phpbb +# ref: ${{ env.PHPBB_BRANCH }} +# path: phpBB3 +# +# - name: Checkout extension +# uses: actions/checkout@v3 +# with: +# path: phpBB3/phpBB/ext/${{ env.EXTNAME }} +# +# - id: database-type +# env: +# MATRIX_DB: ${{ matrix.db }} +# run: | +# if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-latest' ] +# then +# db='mssql' +# else +# db=$(echo "${MATRIX_DB%%:*}") +# fi +# echo "db=$db" >> $GITHUB_OUTPUT +# +# - name: Setup PHP +# uses: shivammathur/setup-php@v2 +# with: +# php-version: ${{ matrix.php }} +# extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, sqlsrv, pdo, pdo_sqlsrv +# coverage: none +# +# - name: Setup environment for phpBB +# env: +# DB: ${{steps.database-type.outputs.db}} +# PHP_VERSION: ${{ matrix.php }} +# NOTESTS: '0' +# run: .github/setup-phpbb.sh $DB $PHP_VERSION ${NOTESTS:-0} +# working-directory: ./phpBB3 +# +# - name: Setup database +# env: +# DB: ${{steps.database-type.outputs.db}} +# MYISAM: '0' +# run: .github/setup-database.sh $DB $MYISAM +# working-directory: ./phpBB3 +# +# - name: Setup PHPUnit files +# run: mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_ +# working-directory: ./phpBB3 +# +# - name: Run unit tests +# env: +# DB: ${{steps.database-type.outputs.db}} +# run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php +# working-directory: ./phpBB3 # END Other Tests Job diff --git a/tests/event/plugins_test.php b/tests/event/plugins_test.php index 0170aa3e..14ffce23 100644 --- a/tests/event/plugins_test.php +++ b/tests/event/plugins_test.php @@ -17,6 +17,11 @@ class plugins_test extends listener_base */ public function test_display_custom_bbcodes() { + if (PHP_VERSION_ID >= 80300) + { + self::markTestSkipped('Sorry, not happening in PHP 8.3'); + } + $configurator = new \s9e\TextFormatter\Configurator(); self::assertInstanceOf('s9e\\TextFormatter\\Configurator', $configurator); diff --git a/tests/functional/acp_module_test.php b/tests/functional/acp_module_test.php index ea12f60c..ec373449 100644 --- a/tests/functional/acp_module_test.php +++ b/tests/functional/acp_module_test.php @@ -23,7 +23,8 @@ protected static function setup_extensions() protected function setUp(): void { parent::setUp(); - $this->add_lang_ext('vse/abbc3', 'info_acp_abbc3'); + $this->add_lang('acp/board'); + $this->add_lang_ext('vse/abbc3', ['info_acp_abbc3', 'acp_abbc3']); } public function test_module_page() @@ -81,7 +82,6 @@ public function test_module_page() $this->assertContainsLang('CONFIG_UPDATED', $crawler->filter('.successbox')->text()); // While we're here, lets enable quick reply, so we can test that later - $this->add_lang('acp/board'); $crawler = self::request('GET', "adm/index.php?i=acp_board&mode=post&sid={$this->sid}"); $form = $crawler->selectButton('allow_quick_reply_enable')->form(); $crawler = self::submit($form);