diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e1e35f72..6b04b1a4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,7 @@ env: SNIFF: 1 # Run code sniffer on your code? 1 or 0 IMAGE_ICC: 0 # Run icc profile sniffer on your images? 1 or 0 EPV: 1 # Run EPV (Extension Pre Validator) on your code? 1 or 0 - EXECUTABLE_FILES: 1 # Run check for executable files? 1 or 0 + EXECUTABLE_FILES: 0 # Run check for executable files? 1 or 0 PHPBB_BRANCH: 3.3.x # The phpBB branch to run tests on on: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index eb5434c1..00000000 --- a/.travis.yml +++ /dev/null @@ -1,80 +0,0 @@ -language: php -sudo: required -dist: precise - -matrix: - include: - - php: 5.4 - 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.4 - env: DB=mysqli;SLOWTESTS=1 - - 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: hhvm - - php: nightly - fast_finish: true - -env: - global: - - EXTNAME="board3/portal" - - SNIFF="1" # Should we run code sniffer on your code? - - IMAGE_ICC="0" # 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? - - SPELLCHECK="1" # Should the php files be checked for obvious spelling errors? - - PHPBB_BRANCH="3.2.x" - -branches: - except: - - 2.0.x - - develop-1_0_X - -install: - - php composer.phar install --dev --no-interaction --prefer-source - - travis/prepare-phpbb.sh $EXTNAME $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 ../board3/Board3-Portal/travis/prepare-coverage.sh $DB $TRAVIS_PHP_VERSION; fi" - -before_script: - - travis/setup-database.sh $DB $TRAVIS_PHP_VERSION - - mkdir build/logs - - chmod +wx build/logs - -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 [ '$NOTESTS' != '1' ]; then ../board3/Board3-Portal/travis/run-testsuite.sh $DB $TRAVIS_PHP_VERSION; fi" - - sh -c "if [ '$EPV' != '0' ]; then ../board3/Board3-Portal/travis/run-epv.sh $DB $TRAVIS_PHP_VERSION $EXTNAME; fi" - -after_script: - - sh -c "if [ '$COVERAGE' != '0' ]; then ../board3/Board3-Portal/travis/send-coverage.sh $DB $TRAVIS_PHP_VERSION; fi" - -notifications: - email: - recipients: - - admin@m-a-styles.de - on_success: change - on_failure: change diff --git a/acp/portal_module.php b/acp/portal_module.php index 3aa4c7ef..e2b0e97b 100644 --- a/acp/portal_module.php +++ b/acp/portal_module.php @@ -12,7 +12,7 @@ namespace board3\portal\acp; class portal_module { public $u_action; - public $new_config = array(); + public $new_config = []; /** @var \board3\portal\modules\module_interface */ protected $c_class; @@ -148,7 +148,7 @@ class portal_module $groups_ary = explode(',', $module_data['module_group_ids']); // get group info from database and assign the block vars - $sql = 'SELECT group_id, group_name + $sql = 'SELECT group_id, group_name FROM ' . GROUPS_TABLE . ' ORDER BY group_id ASC'; $result = $this->db->sql_query($sql); @@ -318,7 +318,7 @@ class portal_module $this->page_title = $display_vars['title']; $this->template->assign_vars(array( - 'L_TITLE' => $this->user->lang[$display_vars['title']], + 'L_TITLE' => $this->user->lang($display_vars['title']), 'L_TITLE_EXPLAIN' => (isset($this->user->lang[$display_vars['title'] . '_EXP'])) ? $this->user->lang[$display_vars['title'] . '_EXP'] : '', 'S_ERROR' => (sizeof($error)) ? true : false, diff --git a/composer.json b/composer.json index a47aaaeb..6d6a174e 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,6 @@ "marc1706/phpbb-text-shortener": "^0.2.0" }, "require-dev": { - "phpbb/epv": "dev-master" }, "extra": { "display-name": "Board3 Portal", diff --git a/composer.lock b/composer.lock index 5701103b..e45e71de 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "382239948b2fb39128c8c9b3861006eb", + "content-hash": "4363e3a815df23abd882e44e2278fe8f", "packages": [ { "name": "marc1706/phpbb-text-shortener", @@ -65,1736 +65,15 @@ "time": "2021-08-27T18:27:38+00:00" } ], - "packages-dev": [ - { - "name": "composer/ca-bundle", - "version": "1.2.10", - "source": { - "type": "git", - "url": "https://github.com/composer/ca-bundle.git", - "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/9fdb22c2e97a614657716178093cd1da90a64aa8", - "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8", - "shasum": "" - }, - "require": { - "ext-openssl": "*", - "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.55", - "psr/log": "^1.0", - "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\CaBundle\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", - "keywords": [ - "cabundle", - "cacert", - "certificate", - "ssl", - "tls" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.10" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2021-06-07T13:58:28+00:00" - }, - { - "name": "composer/composer", - "version": "1.10.22", - "source": { - "type": "git", - "url": "https://github.com/composer/composer.git", - "reference": "28c9dfbe2351635961f670773e8d7b17bc5eda25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/28c9dfbe2351635961f670773e8d7b17bc5eda25", - "reference": "28c9dfbe2351635961f670773e8d7b17bc5eda25", - "shasum": "" - }, - "require": { - "composer/ca-bundle": "^1.0", - "composer/semver": "^1.0", - "composer/spdx-licenses": "^1.2", - "composer/xdebug-handler": "^1.1", - "justinrainbow/json-schema": "^5.2.10", - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0", - "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.0", - "symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0" - }, - "conflict": { - "symfony/console": "2.8.38" - }, - "require-dev": { - "phpspec/prophecy": "^1.10", - "symfony/phpunit-bridge": "^4.2" - }, - "suggest": { - "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", - "ext-zip": "Enabling the zip extension allows you to unzip archives", - "ext-zlib": "Allow gzip compression of HTTP requests" - }, - "bin": [ - "bin/composer" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\": "src/Composer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", - "homepage": "https://getcomposer.org/", - "keywords": [ - "autoload", - "dependency", - "package" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/1.10.22" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2021-04-27T11:10:45+00:00" - }, - { - "name": "composer/semver", - "version": "1.7.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/647490bbcaf7fc4891c58f47b825eb99d19c377a", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/1.7.2" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2020-12-03T15:47:16+00:00" - }, - { - "name": "composer/spdx-licenses", - "version": "1.5.5", - "source": { - "type": "git", - "url": "https://github.com/composer/spdx-licenses.git", - "reference": "de30328a7af8680efdc03e396aad24befd513200" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/de30328a7af8680efdc03e396aad24befd513200", - "reference": "de30328a7af8680efdc03e396aad24befd513200", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Spdx\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "SPDX licenses list and validation library.", - "keywords": [ - "license", - "spdx", - "validator" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2020-12-03T16:04:16+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "1.4.6", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2021-03-25T17:01:18+00:00" - }, - { - "name": "gitonomy/gitlib", - "version": "v0.1.8", - "source": { - "type": "git", - "url": "https://github.com/gitonomy/gitlib.git", - "reference": "f575b8f7da917ade7890c6aa705fa22545690389" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/gitonomy/gitlib/zipball/f575b8f7da917ade7890c6aa705fa22545690389", - "reference": "f575b8f7da917ade7890c6aa705fa22545690389", - "shasum": "" - }, - "require": { - "symfony/process": "^2.3|^3.0" - }, - "require-dev": { - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Add some log" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Gitonomy\\Git\\": "src/Gitonomy/Git/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alexandre Salomé", - "email": "alexandre.salome@gmail.com", - "homepage": "http://alexandre-salome.fr" - }, - { - "name": "Julien DIDIER", - "email": "genzo.wm@gmail.com", - "homepage": "http://www.jdidier.net" - } - ], - "description": "Library for accessing git", - "homepage": "http://gitonomy.com", - "support": { - "issues": "https://github.com/gitonomy/gitlib/issues", - "source": "https://github.com/gitonomy/gitlib/tree/master" - }, - "time": "2015-12-01T22:25:57+00:00" - }, - { - "name": "justinrainbow/json-schema", - "version": "5.2.11", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ab6744b7296ded80f8cc4f9509abbff393399aa", - "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", - "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.35" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "support": { - "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.11" - }, - "time": "2021-07-22T09:24:00+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v3.1.5", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v3.1.5" - }, - "time": "2018-02-28T20:30:58+00:00" - }, - { - "name": "phpbb/epv", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/phpbb/epv.git", - "reference": "f79c2f60406786873d9d3c4d26de2983ffbfd2ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpbb/epv/zipball/f79c2f60406786873d9d3c4d26de2983ffbfd2ef", - "reference": "f79c2f60406786873d9d3c4d26de2983ffbfd2ef", - "shasum": "" - }, - "require": { - "composer/composer": "^1.5", - "gitonomy/gitlib": "0.1.*@dev", - "nikic/php-parser": "~3.0", - "php": ">=7.0", - "sensiolabs/ansi-to-html": "~1.1", - "symfony/console": "^3.0|^4.0|^5.0", - "symfony/finder": "^3.0|^4.0|^5.0", - "symfony/process": "^3.0|^4.0|^5.0", - "symfony/yaml": "^3.0|^4.0|^5.0" - }, - "require-dev": { - "phpunit/phpunit": "~5.4", - "phpunit/phpunit-mock-objects": "~3.2" - }, - "default-branch": true, - "bin": [ - "src/EPV.php" - ], - "type": "library", - "autoload": { - "psr-4": { - "Phpbb\\Epv\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-only" - ], - "authors": [ - { - "name": "Paul Sohier", - "email": "paul@phpbb.com" - } - ], - "description": "A extension validator for phpBB extensions. Extensions are required to pass the validator when submitted to the extension database.", - "support": { - "issues": "https://github.com/phpbb/epv/issues", - "source": "https://github.com/phpbb/epv/tree/master" - }, - "time": "2021-02-26T18:45:45+00:00" - }, - { - "name": "psr/container", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" - }, - "time": "2021-03-05T17:36:06+00:00" - }, - { - "name": "psr/log", - "version": "1.1.4", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" - }, - "time": "2021-05-03T11:20:27+00:00" - }, - { - "name": "seld/jsonlint", - "version": "1.8.3", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9ad6ce79c342fbd44df10ea95511a1b24dee5b57", - "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "bin": [ - "bin/jsonlint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Seld\\JsonLint\\": "src/Seld/JsonLint/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ], - "support": { - "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.8.3" - }, - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", - "type": "tidelift" - } - ], - "time": "2020-11-11T09:19:24+00:00" - }, - { - "name": "seld/phar-utils", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/749042a2315705d2dfbbc59234dd9ceb22bf3ff0", - "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\PharUtils\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "PHAR file format utilities, for when PHP phars you up", - "keywords": [ - "phar" - ], - "support": { - "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.1.2" - }, - "time": "2021-08-19T21:01:38+00:00" - }, - { - "name": "sensiolabs/ansi-to-html", - "version": "v1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sensiolabs/ansi-to-html.git", - "reference": "94a3145aae4733ff933c8910263ef56d1ae317a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/ansi-to-html/zipball/94a3145aae4733ff933c8910263ef56d1ae317a9", - "reference": "94a3145aae4733ff933c8910263ef56d1ae317a9", - "shasum": "" - }, - "require": { - "php": ">=7.2.5" - }, - "conflict": { - "twig/twig": "< 2.4.0" - }, - "require-dev": { - "twig/twig": "^2.4 || ^3.0" - }, - "suggest": { - "twig/twig": "Provides nice templating features" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "psr-4": { - "SensioLabs\\AnsiConverter\\": "SensioLabs/AnsiConverter" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "A library to convert a text with ANSI codes to HTML", - "support": { - "issues": "https://github.com/sensiolabs/ansi-to-html/issues", - "source": "https://github.com/sensiolabs/ansi-to-html/tree/v1.2.1" - }, - "time": "2020-10-06T05:48:55+00:00" - }, - { - "name": "symfony/console", - "version": "v4.4.29", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "8baf0bbcfddfde7d7225ae8e04705cfd1081cd7b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8baf0bbcfddfde7d7225ae8e04705cfd1081cd7b", - "reference": "8baf0bbcfddfde7d7225ae8e04705cfd1081cd7b", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3|>=5", - "symfony/lock": "<4.4", - "symfony/process": "<3.3" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/event-dispatcher": "^4.3", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^3.4|^4.0|^5.0", - "symfony/var-dumper": "^4.3|^5.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/console/tree/v4.4.29" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-07-27T19:04:53+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-03-23T23:28:01+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v5.3.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/343f4fe324383ca46792cae728a3b6e2f708fb32", - "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.3.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-07-21T12:40:44+00:00" - }, - { - "name": "symfony/finder", - "version": "v5.3.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "17f50e06018baec41551a71a15731287dbaab186" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/17f50e06018baec41551a71a15731287dbaab186", - "reference": "17f50e06018baec41551a71a15731287dbaab186", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v5.3.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-07-23T15:54:19+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.23.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-02-19T12:13:01+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-05-27T12:26:48+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.23.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-02-19T12:13:01+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.23.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-07-28T13:41:28+00:00" - }, - { - "name": "symfony/process", - "version": "v3.4.47", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "b8648cf1d5af12a44a51d07ef9bf980921f15fca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b8648cf1d5af12a44a51d07ef9bf980921f15fca", - "reference": "b8648cf1d5af12a44a51d07ef9bf980921f15fca", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v2.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/container": "^1.1" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-04-01T10:43:52+00:00" - }, - { - "name": "symfony/yaml", - "version": "v5.3.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7", - "reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<4.4" - }, - "require-dev": { - "symfony/console": "^4.4|^5.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "bin": [ - "Resources/bin/yaml-lint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Loads and dumps YAML files", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v5.3.6" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-07-29T06:20:01+00:00" - } - ], + "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "phpbb/epv": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.1.3" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "1.1.0" } diff --git a/composer.phar b/composer.phar index 2a5ae2ea..c5d58952 100755 Binary files a/composer.phar and b/composer.phar differ diff --git a/controller/helper.php b/controller/helper.php index bcd72257..2a0f8694 100644 --- a/controller/helper.php +++ b/controller/helper.php @@ -266,7 +266,7 @@ class helper $this->check_permission(); // Load language file - $this->user->add_lang_ext('board3/portal', 'portal'); + $this->language->add_lang('portal', 'board3/portal'); // Obtain portal config obtain_portal_config(); diff --git a/controller/main.php b/controller/main.php index 88d7e459..7727891d 100644 --- a/controller/main.php +++ b/controller/main.php @@ -117,8 +117,11 @@ class main $this->includes_path = $phpbb_root_path . 'ext/board3/portal/includes/'; $this->root_path = $phpbb_root_path . 'ext/board3/portal/'; $portal_root_path = $this->root_path; - define('PORTAL_MODULES_TABLE', $modules_table); - define('PORTAL_CONFIG_TABLE', $config_table); + if (!defined('PORTAL_MODULES_TABLE')) + { + define('PORTAL_MODULES_TABLE', $modules_table); + define('PORTAL_CONFIG_TABLE', $config_table); + } if (!function_exists('obtain_portal_config')) { diff --git a/includes/functions.php b/includes/functions.php index dd75bed3..12f6b875 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -93,21 +93,6 @@ function obtain_portal_modules() return $portal_modules; } -/** -* Fetch post for news & announce -* -* @deprecated 2.1.0-b1 (To be removed: 2.2.0) -*/ -function phpbb_fetch_posts($module_id, $forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start = 0, $invert = false) -{ - global $phpbb_container; - - $fetch_posts = $phpbb_container->get('board3.portal.fetch_posts'); - $fetch_posts->set_module_id($module_id); - - return $fetch_posts->get_posts($forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start, $invert); -} - /** * Censor title, return short title * @@ -390,7 +375,7 @@ function check_file_src($value, $key, $module_id, $force_error = true) // We check if the chosen file is present in the styles/all/ folder if (!file_exists($portal_root_path . 'styles/all/theme/images/portal/' . $value)) { - $error .= $user->lang['B3P_FILE_NOT_FOUND'] . ': styles/all/theme/images/portal/' . $value . '
'; + $error .= $user->lang('B3P_FILE_NOT_FOUND') . ': styles/all/theme/images/portal/' . $value . '
'; } if (!empty($error)) diff --git a/modules/announcements.php b/modules/announcements.php index 5d3a10a8..573aba16 100644 --- a/modules/announcements.php +++ b/modules/announcements.php @@ -131,7 +131,7 @@ class announcements extends module_base $this->config['board3_announcements_permissions_' . $module_id], $this->config['board3_number_of_announcements_' . $module_id], $portal_announcement_length, - $this->config['board3_announcements_day_' . $module_id], + (int) $this->config['board3_announcements_day_' . $module_id], 'announcements', $start, (bool) $this->config['board3_announcements_forum_exclude_' . $module_id] @@ -174,7 +174,7 @@ class announcements extends module_base $forum_from = $this->config['board3_global_announcements_forum_' . $module_id]; $forum_from = (strpos($forum_from, ',') !== false) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array()); - $time = ($this->config['board3_announcements_day_' . $module_id] == 0) ? 0 : $this->config['board3_announcements_day_' . $module_id]; + $time = ($this->config['board3_announcements_day_' . $module_id] == 0) ? 0 : (int) $this->config['board3_announcements_day_' . $module_id]; $post_time = ($time == 0) ? '' : 'AND topic_time > ' . (time() - $time * 86400); $str_where = ''; diff --git a/modules/calendar.php b/modules/calendar.php index 60e5f6d4..973e3e1c 100644 --- a/modules/calendar.php +++ b/modules/calendar.php @@ -188,19 +188,19 @@ class calendar extends module_base // output our general calendar bits $down = $this->mini_cal_month - 1; $up = $this->mini_cal_month + 1; - $prev_month = ''; - $next_month = ''; + $prev_month = ''; + $next_month = ''; $this->template->assign_block_vars('minical', array( 'S_SUNDAY_FIRST' => ($this->config['board3_sunday_first_' . $module_id]) ? true : false, - 'L_MINI_CAL_MONTH' => (($this->config['board3_long_month_' . $module_id]) ? $this->user->lang['mini_cal']['long_month'][$this->day[0][1]] : $this->user->lang['mini_cal']['month'][$this->day[0][1]]) . " " . $this->day[0][2], - 'L_MINI_CAL_SUN' => '' . $this->user->lang['mini_cal']['day'][1] . '', - 'L_MINI_CAL_MON' => $this->user->lang['mini_cal']['day'][2], - 'L_MINI_CAL_TUE' => $this->user->lang['mini_cal']['day'][3], - 'L_MINI_CAL_WED' => $this->user->lang['mini_cal']['day'][4], - 'L_MINI_CAL_THU' => $this->user->lang['mini_cal']['day'][5], - 'L_MINI_CAL_FRI' => $this->user->lang['mini_cal']['day'][6], - 'L_MINI_CAL_SAT' => $this->user->lang['mini_cal']['day'][7], + 'L_MINI_CAL_MONTH' => (($this->config['board3_long_month_' . $module_id]) ? $this->user->lang(['mini_cal', 'long_month'], $this->day[0][1]) : $this->user->lang(['mini_cal', 'month'], $this->day[0][1])) . " " . $this->day[0][2], + 'L_MINI_CAL_SUN' => '' . $this->user->lang(['mini_cal', 'day'], 1) . '', + 'L_MINI_CAL_MON' => $this->user->lang(['mini_cal', 'day'], 2), + 'L_MINI_CAL_TUE' => $this->user->lang(['mini_cal', 'day'], 3), + 'L_MINI_CAL_WED' => $this->user->lang(['mini_cal', 'day'], 4), + 'L_MINI_CAL_THU' => $this->user->lang(['mini_cal', 'day'], 5), + 'L_MINI_CAL_FRI' => $this->user->lang(['mini_cal', 'day'], 6), + 'L_MINI_CAL_SAT' => $this->user->lang(['mini_cal', 'day'], 7), 'U_PREV_MONTH' => $prev_month, 'U_NEXT_MONTH' => $next_month, 'S_DISPLAY_EVENTS' => ($this->config['board3_display_events_' . $module_id]) ? true : false, @@ -488,13 +488,13 @@ class calendar extends module_base // Check for errors if (!$event_title) { - trigger_error($this->user->lang['NO_EVENT_TITLE'] . adm_back_link($u_action), E_USER_WARNING); + trigger_error($this->user->lang('NO_EVENT_TITLE') . adm_back_link($u_action), E_USER_WARNING); } // overwrite already existing events and make sure we don't try to save an event outside of the normal array size of $events if (isset($link_id) && $link_id < sizeof($events)) { - $message = $this->user->lang['EVENT_UPDATED']; + $message = $this->user->lang('EVENT_UPDATED'); $events[$link_id] = array( 'title' => $event_title, @@ -510,7 +510,7 @@ class calendar extends module_base } else { - $message = $this->user->lang['EVENT_ADDED']; + $message = $this->user->lang('EVENT_ADDED'); $events[] = array( 'title' => $event_title, diff --git a/portal/modules/constraints_handler.php b/portal/modules/constraints_handler.php index 89a2050f..f5d1d954 100644 --- a/portal/modules/constraints_handler.php +++ b/portal/modules/constraints_handler.php @@ -10,13 +10,14 @@ namespace board3\portal\portal\modules; use board3\portal\portal\columns; +use phpbb\user; class constraints_handler { - /** @var \board3\portal\portal\columns */ + /** @var columns */ protected $portal_columns; - /** @var \phpbb\user */ + /** @var user */ protected $user; /** @var string Form action (link) */ @@ -29,7 +30,7 @@ class constraints_handler * Constructor for constraints handler * * @param columns $portal_columns Portal columns - * @param \phpbb\user $user phpBB user object + * @param user $user phpBB user object */ public function __construct(columns $portal_columns, $user) { diff --git a/portal/modules/database_handler.php b/portal/modules/database_handler.php index 9ee0e0dd..5cbbb3d7 100644 --- a/portal/modules/database_handler.php +++ b/portal/modules/database_handler.php @@ -28,13 +28,13 @@ class database_handler /** @var int Board3 module enabled */ const B3_MODULE_ENABLED = 1; - /** @var \phpbb\db\driver\driver_interface */ + /** @var driver_interface */ protected $db; /** * Constructor for modules manager * - * @param \phpbb\db\driver\driver_interface $db Database driver + * @param driver_interface $db Database driver */ public function __construct(driver_interface $db) { diff --git a/portal/modules/manager.php b/portal/modules/manager.php index a4cc1e14..58533be5 100644 --- a/portal/modules/manager.php +++ b/portal/modules/manager.php @@ -9,42 +9,45 @@ namespace board3\portal\portal\modules; +use board3\portal\controller\helper as b3p_controller_helper; use board3\portal\includes\helper; use board3\portal\modules\module_interface; use board3\portal\portal\columns; +use phpbb\cache\service; use phpbb\db\driver\driver_interface; use phpbb\request\request_interface; +use phpbb\user; class manager { - /** @var \phpbb\cache\service */ + /** @var service */ protected $cache; - /** @var \board3\portal\controller\helper */ + /** @var b3p_controller_helper */ protected $controller_helper; - /** @var \board3\portal\portal\columns */ + /** @var columns */ protected $portal_columns; - /** @var \board3\portal\includes\helper */ + /** @var helper */ protected $portal_helper; - /** @var \board3\portal\portal\modules\constraints_handler */ + /** @var constraints_handler */ protected $constraints_handler; - /** @var \board3\portal\portal\modules\database_handler */ + /** @var database_handler */ protected $database_handler; - /** @var \phpbb\db\driver\driver_interface */ + /** @var driver_interface */ protected $db; - /** @var \phpbb\request\request_interface */ + /** @var request_interface */ protected $request; - /** @var \phpbb\user */ + /** @var user */ protected $user; - /** @var \board3\portal\modules\module_interface */ + /** @var module_interface */ protected $module; /** @var string u_action of acp module */ @@ -56,17 +59,26 @@ class manager /** * Constructor for modules manager * - * @param \phpbb\cache\service $cache phpBB cache - * @param \phpbb\db\driver\driver_interface $db Database driver - * @param \board3\portal\controller\helper $controller_helper Board3 Portal controller helper - * @param \board3\portal\portal\columns $portal_columns Portal columns helper - * @param \board3\portal\includes\helper $portal_helper Portal helper - * @param \board3\portal\portal\modules\constraints_handler $constraints_handler Modules constraints handler - * @param \board3\portal\portal\modules\database_handler $database_handler Modules database handler - * @param \phpbb\request\request_interface $request phpBB request - * @param \phpbb\user $user phpBB user + * @param service $cache phpBB cache + * @param driver_interface $db Database driver + * @param b3p_controller_helper $controller_helper Board3 Portal controller helper + * @param columns $portal_columns Portal columns helper + * @param helper $portal_helper Portal helper + * @param constraints_handler $constraints_handler Modules constraints handler + * @param database_handler $database_handler Modules database handler + * @param request_interface $request phpBB request + * @param user $user phpBB user */ - public function __construct($cache, driver_interface $db, \board3\portal\controller\helper $controller_helper, columns $portal_columns, helper $portal_helper, constraints_handler $constraints_handler, database_handler $database_handler, request_interface $request, $user) + public function __construct( + service $cache, + driver_interface $db, + b3p_controller_helper $controller_helper, + columns $portal_columns, + helper $portal_helper, + constraints_handler $constraints_handler, + database_handler $database_handler, + request_interface $request, + user $user) { $this->cache = $cache; $this->db = $db; @@ -84,7 +96,7 @@ class manager * * @param string $u_action u_action for module * - * @return \board3\portal\portal\modules\manager This class + * @return manager This class */ public function set_u_action($u_action) { @@ -99,7 +111,7 @@ class manager * * @param string $acp_class ACP module class * - * @return \board3\portal\portal\modules\manager This class + * @return manager This class */ public function set_acp_class($acp_class) { diff --git a/tests/functional/portal_acp_test.php b/tests/functional/portal_acp_test.php index 7dd4eaad..597f22b8 100644 --- a/tests/functional/portal_acp_test.php +++ b/tests/functional/portal_acp_test.php @@ -63,10 +63,10 @@ class phpbb_functional_portal_acp_test extends \board3\portal\tests\testframewor $crawler = self::request('GET', $module_link); preg_match('/module_classname=(?:([a-z0-9\\\_]+))/', $module_link, $module_name); $module_name = $module_name[1]; - $this->assertContains('Are you sure you wish to delete the module', $crawler->text()); + $this->assertStringContainsString('Are you sure you wish to delete the module', $crawler->text()); $form = $crawler->selectButton('confirm')->form(); $crawler = self::submit($form); - $this->assertContains('The module was removed successfully.', $crawler->text()); + $this->assertStringContainsString('The module was removed successfully.', $crawler->text()); // Add it back $crawler = self::request('GET', 'adm/index.php?i=\board3\portal\acp\portal_module&mode=modules&add[center]=true&module_column=2&sid=' . $this->sid); @@ -85,7 +85,7 @@ class phpbb_functional_portal_acp_test extends \board3\portal\tests\testframewor // Take a look at the logs $crawler = self::request('GET', 'adm/index.php?i=acp_logs&mode=admin&sid=' . $this->sid); - $this->assertContains(strip_tags(html_entity_decode($this->lang('LOG_PORTAL_CONFIG', $this->lang('ACP_PORTAL_GENERAL_INFO')), ENT_COMPAT, 'UTF-8')), $crawler->text()); + $this->assertStringContainsString(strip_tags(html_entity_decode($this->lang('LOG_PORTAL_CONFIG', $this->lang('ACP_PORTAL_GENERAL_INFO')), ENT_COMPAT, 'UTF-8')), $crawler->text()); } public function test_portal_permissions() @@ -105,9 +105,9 @@ class phpbb_functional_portal_acp_test extends \board3\portal\tests\testframewor $form->setValues(array('link_title' => 'foobar')); $crawler = self::submit($form); $crawler = self::request('GET', 'adm/index.php?i=\board3\portal\acp\portal_module&mode=config&module_id=1&sid=' . $this->sid); - $this->assertContains('foobar', $crawler->text()); + $this->assertStringContainsString('foobar', $crawler->text()); $crawler = self::request('GET', 'app.php/portal?sid=' . $this->sid); - $this->assertContains('foobar', $crawler->text()); + $this->assertStringContainsString('foobar', $crawler->text()); } public function data_add_second_module() @@ -131,6 +131,6 @@ class phpbb_functional_portal_acp_test extends \board3\portal\tests\testframewor $form = $crawler->selectButton('submit')->form(); $form['module_classname']->disableValidation()->select($module_class); $crawler = self::submit($form); - $this->assertContains($expected_message, $crawler->text()); + $this->assertStringContainsString($expected_message, $crawler->text()); } } diff --git a/tests/functional/portal_announcement_test.php b/tests/functional/portal_announcement_test.php index 05f05be1..6edfb2d2 100644 --- a/tests/functional/portal_announcement_test.php +++ b/tests/functional/portal_announcement_test.php @@ -60,6 +60,8 @@ class phpbb_functional_portal_announcement_test extends \board3\portal\tests\tes public function test_shortened_message() { + $this->purge_cache(); + // Create topic as announcement $data = $this->create_topic(2, 'Portal-announce-global', str_repeat('This is a global announcement for the portal', 6), array( 'topic_type' => POST_GLOBAL, @@ -69,7 +71,7 @@ class phpbb_functional_portal_announcement_test extends \board3\portal\tests\tes { // no errors should appear on portal $crawler = self::request('GET', 'app.php/portal'); - $this->assertContains('This is a global announc ...', $crawler->text()); + $this->assertStringContainsString('This is a global announc ...', $crawler->text()); } } } diff --git a/tests/functional/portal_birthday_list_test.php b/tests/functional/portal_birthday_list_test.php index fc8010fa..fb5d46b0 100644 --- a/tests/functional/portal_birthday_list_test.php +++ b/tests/functional/portal_birthday_list_test.php @@ -47,6 +47,6 @@ class phpbb_functional_portal_birthday_list_test extends \board3\portal\tests\te public function test_after_announce() { $crawler = self::request('GET', 'app.php/portal'); - $this->assertContains(date('d M', time() + 86400*2), $crawler->html()); + $this->assertStringContainsString(date('d M', time() + 86400*2), $crawler->html()); } } diff --git a/tests/functional/portal_link_test.php b/tests/functional/portal_link_test.php index dde9fe38..2b860cd8 100644 --- a/tests/functional/portal_link_test.php +++ b/tests/functional/portal_link_test.php @@ -23,7 +23,7 @@ class phpbb_functional_portal_link_test extends \board3\portal\tests\testframewo public function test_portal_link() { $crawler = self::request('GET', 'index.php?sid=' . $this->sid); - $this->assertContains('Portal', $crawler->text()); + $this->assertStringContainsString('Portal', $crawler->text()); } public function test_disabled_portal_link() @@ -46,7 +46,7 @@ class phpbb_functional_portal_link_test extends \board3\portal\tests\testframewo }); foreach ($vals as $val) { - $this->assertNotContains('Portal', $val); + $this->assertStringNotContainsString('Portal', $val); } // Try to access portal directly @@ -56,7 +56,7 @@ class phpbb_functional_portal_link_test extends \board3\portal\tests\testframewo }); foreach ($vals as $val) { - $this->assertNotContains('Portal', $val); + $this->assertStringNotContainsString('Portal', $val); } // Enable portal again diff --git a/tests/functional/portal_no_error_test.php b/tests/functional/portal_no_error_test.php index 4a76937c..6c2e8543 100644 --- a/tests/functional/portal_no_error_test.php +++ b/tests/functional/portal_no_error_test.php @@ -42,7 +42,7 @@ class phpbb_functional_portal_no_error_test extends \board3\portal\tests\testfra public function test_portal_all_pages($style_id) { $crawler = self::request('GET', 'index.php?style=' . $style_id); - $this->assertNotContains('Menu', $crawler->text()); + $this->assertStringNotContainsString('Menu', $crawler->text()); $crawler = self::request('GET', 'adm/index.php?i=-board3-portal-acp-portal_module&mode=config&sid=' . $this->sid); @@ -54,7 +54,7 @@ class phpbb_functional_portal_no_error_test extends \board3\portal\tests\testfra $this->assertContainsLang('CONFIG_UPDATED', $crawler->text()); $crawler = self::request('GET', 'index.php?style=' . $style_id); - $this->assertContains('Menu', $crawler->text()); + $this->assertStringContainsString('Menu', $crawler->text()); $crawler = self::request('GET', 'adm/index.php?i=-board3-portal-acp-portal_module&mode=config&sid=' . $this->sid); @@ -66,8 +66,8 @@ class phpbb_functional_portal_no_error_test extends \board3\portal\tests\testfra $this->assertContainsLang('CONFIG_UPDATED', $crawler->text()); $crawler = self::request('GET', 'index.php?style=' . $style_id); - $this->assertNotContains('Board Style', $crawler->text()); - $this->assertContains('User menu', $crawler->text()); + $this->assertStringNotContainsString('Board Style', $crawler->text()); + $this->assertStringContainsString('User menu', $crawler->text()); $crawler = self::request('GET', 'adm/index.php?i=-board3-portal-acp-portal_module&mode=config&sid=' . $this->sid); @@ -79,6 +79,6 @@ class phpbb_functional_portal_no_error_test extends \board3\portal\tests\testfra $this->assertContainsLang('CONFIG_UPDATED', $crawler->text()); $crawler = self::request('GET', 'index.php?style=' . $style_id); - $this->assertNotContains('Menu', $crawler->text()); + $this->assertStringNotContainsString('Menu', $crawler->text()); } } diff --git a/tests/functional/portal_redirect_test.php b/tests/functional/portal_redirect_test.php index bcc88e93..dbad43a8 100644 --- a/tests/functional/portal_redirect_test.php +++ b/tests/functional/portal_redirect_test.php @@ -29,13 +29,13 @@ class phpbb_functional_portal_redirect_test extends \board3\portal\tests\testfra } else { - $mod_rewrite = (getenv('HTTP_MOD_REWRITE')=='On') ? true : false; + $mod_rewrite = getenv('HTTP_MOD_REWRITE') == 'On'; } if ($mod_rewrite) { $crawler = self::request('GET', ''); - $this->assertContains('Board3 Portal', $crawler->text()); + $this->assertStringContainsString('Board3 Portal', $crawler->text()); } } @@ -44,7 +44,7 @@ class phpbb_functional_portal_redirect_test extends \board3\portal\tests\testfra // Make sure we are logged out $this->logout(); - $crawler = self::request('GET', 'app.php/portal?sid=' . $this->sid); + $crawler = self::request('GET', 'app.php/portal'); $form = $crawler->selectButton('Login')->form(); $form->setValues(array( 'username' => 'admin', @@ -54,6 +54,6 @@ class phpbb_functional_portal_redirect_test extends \board3\portal\tests\testfra $crawler = self::submit($form); // Should be redirected to portal and logged in - $this->assertContains('Site Admin', $crawler->text()); + $this->assertStringContainsString('Site Admin', $crawler->text()); } } diff --git a/tests/functional/portal_visit_registered_test.php b/tests/functional/portal_visit_registered_test.php index ed416f93..ffee94c6 100644 --- a/tests/functional/portal_visit_registered_test.php +++ b/tests/functional/portal_visit_registered_test.php @@ -103,8 +103,8 @@ class phpbb_functional_portal_visit_registered_test extends \board3\portal\tests $crawler = self::request('GET', 'app.php/portal'); $legend = $crawler->filter('dd.portal-responsive-show p em')->text(); - $this->assertContains('Administrators', $legend); - $this->assertContains('Global moderators', $legend); + $this->assertStringContainsString('Administrators', $legend); + $this->assertStringContainsString('Global moderators', $legend); } public function test_setup_hidden_forum() @@ -121,7 +121,7 @@ class phpbb_functional_portal_visit_registered_test extends \board3\portal\tests $form = $crawler->selectButton('Submit')->form(); $form['forum_perm_from']->select(2); $crawler = self::submit($form); - $this->assertContains('Forum created successfully', $crawler->text()); + $this->assertStringContainsString('Forum created successfully', $crawler->text()); // Hide forum using permissions from registered users $crawler = self::request('GET', 'adm/index.php?i=acp_permissions&mode=setting_group_local&sid=' . $this->sid); @@ -180,8 +180,8 @@ class phpbb_functional_portal_visit_registered_test extends \board3\portal\tests $this->logout(); $this->login('standard-user'); $crawler = self::request('GET', 'index.php'); - $this->assertNotContains('Hidden forum', $crawler->text()); + $this->assertStringNotContainsString('Hidden forum', $crawler->text()); $crawler = self::request('GET', 'app.php/portal'); - $this->assertNotContains('Hidden topic', $crawler->text()); + $this->assertStringNotContainsString('Hidden topic', $crawler->text()); } } diff --git a/tests/functional/portal_vote_poll_test.php b/tests/functional/portal_vote_poll_test.php index 43a8b5ed..8bd195ac 100644 --- a/tests/functional/portal_vote_poll_test.php +++ b/tests/functional/portal_vote_poll_test.php @@ -33,10 +33,10 @@ class phpbb_functional_portal_vote_poll_test extends \board3\portal\tests\testfr $crawler = self::request('GET', 'app.php/portal'); $form = $crawler->selectButton('Submit vote')->form(); $form->setValues(array('vote_id' => array(1))); - $crawler = self::submit($form); + self::submit($form); // no errors should appear on portal - $crawler = self::request('GET', 'app.php/portal'); + self::request('GET', 'app.php/portal'); } } @@ -46,6 +46,6 @@ class phpbb_functional_portal_vote_poll_test extends \board3\portal\tests\testfr public function test_after_poll() { $this->logout(); - $crawler = self::request('GET', 'app.php/portal'); + self::request('GET', 'app.php/portal'); } } diff --git a/tests/mock/language.php b/tests/mock/language.php new file mode 100644 index 00000000..63cd3033 --- /dev/null +++ b/tests/mock/language.php @@ -0,0 +1,61 @@ + $column) + { + $this->lang[$key] = $column; + } + } + + public function add_lang($component, $extension_name = null) + { + if (!$extension_name !== null) + { + $this->add_lang_ext($extension_name, $component); + } + else + { + parent::add_lang($component, $extension_name); + } + } + + public function add_lang_ext($ext_name, $lang_set, $use_db = false, $use_help = false) + { + if ($ext_name != 'board3/portal') + { + return; // can't support other extensions + } + + if (is_array($lang_set)) + { + foreach ($lang_set as $cur_file) + { + $this->add_lang_ext($ext_name, $cur_file); + } + return; + } + + if (file_exists(dirname(__FILE__) . '/../../language/en/' . $lang_set . '.php')) + { + $foo = dirname(__FILE__) . '/../../language/en/' . $lang_set . '.php'; + include(dirname(__FILE__) . '/../../language/en/' . $lang_set . '.php'); + + if (isset($lang)) + { + $this->set($lang); + } + } + } +} diff --git a/tests/mock/template.php b/tests/mock/template.php index 30e7bb5a..16860e37 100644 --- a/tests/mock/template.php +++ b/tests/mock/template.php @@ -64,6 +64,11 @@ class template $this->test_case->assertSame($expected, $this->data[$row]); } + public function assert_not_exist($row) + { + $this->test_case->assertArrayNotHasKey($row, $this->data); + } + public function delete_var($key) { unset($this->data[$key]); @@ -71,6 +76,6 @@ class template public function get_row($row) { - return $this->data[$row]; + return $this->data[$row] ?? null; } } diff --git a/tests/mock/user.php b/tests/mock/user.php deleted file mode 100644 index 423543bb..00000000 --- a/tests/mock/user.php +++ /dev/null @@ -1,61 +0,0 @@ -assertTrue(is_array($data)); - - foreach ($data as $key => $column) - { - $this->lang[$key] = $column; - } - } - - public function add_lang_ext($ext, $file) - { - if ($ext != 'board3/portal') - { - return; // can't support other extensions - } - - if (is_array($file)) - { - foreach ($file as $cur_file) - { - $this->add_lang_ext($ext, $cur_file); - } - return; - } - - if (file_exists(dirname(__FILE__) . '/../../language/en/' . $file . '.php')) - { - include_once(dirname(__FILE__) . '/../../language/en/' . $file . '.php'); - - if (isset($lang)) - { - $this->set($lang); - } - } - else - { - $this->markTestIncomplete('Unable to include language file ' . $file); - } - } - - public function lang($var) - { - return $this->lang[$var]; - } -} diff --git a/tests/unit/acp/move_module_test.php b/tests/unit/acp/move_module_test.php index 168c21ce..f14d051a 100644 --- a/tests/unit/acp/move_module_test.php +++ b/tests/unit/acp/move_module_test.php @@ -40,17 +40,31 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data public function setUp(): void { parent::setUp(); - global $db, $cache, $phpbb_root_path, $phpEx, $user, $phpbb_container, $request, $template, $table_prefix; + global $config, $db, $cache, $phpbb_root_path, $phpEx, $user, $phpbb_container, $request, $template, $table_prefix; global $phpbb_dispatcher; - $user = new \board3\portal\tests\mock\user(); + $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); + $this->language = new \board3\portal\tests\mock\language($this->language_file_loader); + $user = new \phpbb\user($this->language, '\phpbb\datetime'); + $user->data['user_id'] = 2; + $user->data['user_form_salt'] = 'foobar'; + $user->lang['ACP_PORTAL_GENERAL_TITLE'] = 'ACP_PORTAL_GENERAL_TITLE'; + $user->lang['YES'] = 'YES'; + $user->lang['NO'] = 'NO'; + $this->language->add_lang_ext('board3/portal', 'portal_acp'); + $this->language->set([ + 'ACP_PORTAL_GENERAL_TITLE' => 'ACP_PORTAL_GENERAL_TITLE', + 'PORTAL_SHOW_ALL_LEFT' => 'PORTAL_SHOW_ALL_LEFT', + 'PORTAL_SHOW_ALL_RIGHT' => 'PORTAL_SHOW_ALL_RIGHT', + ]); + $template = new \board3\portal\tests\mock\template($this); $this->template = $template; $request = new \phpbb_mock_request; $this->request = $request; $phpbb_container = new \phpbb_mock_container_builder(); // Mock module service collection - $config = new \phpbb\config\config(array()); + $config = new \phpbb\config\config([]); $auth = $this->getMockBuilder('\phpbb\auth\auth') ->setMethods(['acl_get']) ->getMock(); @@ -75,7 +89,8 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data $phpbb_container->setParameter('board3.portal.config.table', $table_prefix . 'portal_config'); $this->portal_columns = new \board3\portal\portal\columns(); $phpbb_container->set('board3.portal.columns', $this->portal_columns); - $cache = $this->getMockBuilder('\phpbb\cache\cache') + $cache = $this->getMockBuilder('\phpbb\cache\service') + ->disableOriginalConstructor() ->setMethods(['destroy', 'sql_exists', 'get', 'put', 'sql_load', 'sql_save']) ->getMock(); $cache->expects($this->any()) @@ -100,7 +115,7 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data ->with($this->anything()) ->will($this->returnArgument(2)); $db = $this->db; - $user->set(array( + $this->language->set(array( 'UNABLE_TO_MOVE' => 'UNABLE_TO_MOVE', 'UNABLE_TO_MOVE_ROW' => 'UNABLE_TO_MOVE_ROW', )); @@ -124,9 +139,6 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data $phpEx ); - $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); - $this->language = new \phpbb\language\language($this->language_file_loader); - $b3p_controller_helper = new \board3\portal\controller\helper( new \phpbb\auth\auth(), $this->portal_columns, @@ -223,7 +235,7 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data $this->modules_manager->move_module_vertical(2, \board3\portal\portal\modules\database_handler::MOVE_DIRECTION_UP); $this->assertTrue(self::$redirected); - $this->setExpectedTriggerError(E_USER_NOTICE, 'UNABLE_TO_MOVE_ROW'); + $this->setExpectedTriggerError(E_USER_NOTICE, $this->language->lang('UNABLE_TO_MOVE_ROW')); self::$redirected = false; $this->modules_manager->move_module_vertical(2, \board3\portal\portal\modules\database_handler::MOVE_DIRECTION_UP); $this->assertFalse(self::$redirected); @@ -235,7 +247,7 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data $this->modules_manager->move_module_vertical(3, \board3\portal\portal\modules\database_handler::MOVE_DIRECTION_DOWN); $this->assertTrue(self::$redirected); - $this->setExpectedTriggerError(E_USER_NOTICE, 'UNABLE_TO_MOVE_ROW'); + $this->setExpectedTriggerError(E_USER_NOTICE, $this->language->lang('UNABLE_TO_MOVE_ROW')); self::$redirected = false; $this->modules_manager->move_module_vertical(3, \board3\portal\portal\modules\database_handler::MOVE_DIRECTION_DOWN); $this->assertFalse(self::$redirected); @@ -257,7 +269,7 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data { if ($error) { - $this->setExpectedTriggerError(E_USER_NOTICE, $error); + $this->setExpectedTriggerError(E_USER_NOTICE, $this->language->lang($error)); } else { @@ -310,7 +322,7 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data $column_start++; $this->update_portal_modules(); } - $this->setExpectedTriggerError(E_USER_NOTICE, 'UNABLE_TO_MOVE'); + $this->setExpectedTriggerError(E_USER_NOTICE, $this->language->lang('UNABLE_TO_MOVE')); $this->modules_manager->move_module_horizontal($module_id, \board3\portal\portal\modules\database_handler::MOVE_DIRECTION_RIGHT); } @@ -363,7 +375,7 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data $this->update_portal_modules(); $column_start--; } - $this->setExpectedTriggerError(E_USER_NOTICE, 'UNABLE_TO_MOVE'); + $this->setExpectedTriggerError(E_USER_NOTICE, $this->language->lang('UNABLE_TO_MOVE')); $this->modules_manager->move_module_horizontal($module_id, \board3\portal\portal\modules\database_handler::MOVE_DIRECTION_LEFT); } diff --git a/tests/unit/controller/helper_test.php b/tests/unit/controller/helper_test.php index 90c42580..15221289 100644 --- a/tests/unit/controller/helper_test.php +++ b/tests/unit/controller/helper_test.php @@ -40,7 +40,7 @@ class helper_test extends \board3\portal\tests\testframework\test_case )); $this->template = new \board3\portal\tests\mock\template($this); $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); - $this->language = new \phpbb\language\language($this->language_file_loader); + $this->language = new \board3\portal\tests\mock\language($this->language_file_loader); $this->user = new \phpbb\user($this->language, '\phpbb\datetime'); $this->user->data['group_id'] = 2; $this->phpbb_root_path = dirname(__FILE__) . '/../../../../../../'; @@ -48,8 +48,9 @@ class helper_test extends \board3\portal\tests\testframework\test_case $this->language_file_loader->set_extension_manager($phpbb_extension_manager); $this->php_ext = 'php'; $this->portal_columns = new \board3\portal\portal\columns(); + $user = $this->user; $this->modules = array( - '\board3\portal\modules\link_us' => new \board3\portal\modules\link_us($this->config, new \board3\portal\tests\mock\template($this), new \board3\portal\tests\mock\user), + '\board3\portal\modules\link_us' => new \board3\portal\modules\link_us($this->config, new \board3\portal\tests\mock\template($this), $user), ); $this->portal_helper = new \board3\portal\includes\helper($this->modules); $this->path_helper = new \phpbb\path_helper( @@ -144,12 +145,14 @@ class helper_test extends \board3\portal\tests\testframework\test_case public function test_load_module_language() { - $this->assertNull($this->controller_helper->load_module_language($this->modules['\board3\portal\modules\link_us'])); - $this->assertEquals('Link to us', $this->user->lang('LINK_US')); + global $phpbb_root_path; + + $this->controller_helper->load_module_language($this->modules['\board3\portal\modules\link_us']); $this->assertFalse(isset($this->user->lang['PORTAL_LEADERS_EXT'])); + $user = new \phpbb\user($this->language, '\phpbb\datetime'); $module = $this->getMockBuilder('\board3\portal\modules\link_us') ->setMethods(['get_language']) - ->setConstructorArgs([$this->config, new \board3\portal\tests\mock\template($this), new \board3\portal\tests\mock\user]) + ->setConstructorArgs([$this->config, new \board3\portal\tests\mock\template($this), $user]) ->getMock(); $module->expects($this->any()) ->method('get_language') @@ -157,8 +160,8 @@ class helper_test extends \board3\portal\tests\testframework\test_case 'vendor' => 'board3/portal', 'file' => 'modules/portal_leaders_module', )); - $this->assertNull($this->controller_helper->load_module_language($module)); - $this->assertEquals('Team Settings', $this->user->lang('ACP_PORTAL_LEADERS')); + $this->controller_helper->load_module_language($module); + $this->assertNotEmpty($this->language->lang('ACP_PORTAL_LEADERS')); } public function data_assign_module_vars() @@ -169,16 +172,21 @@ class helper_test extends \board3\portal\tests\testframework\test_case 'module_id' => 1, 'module_image_width' => 16, 'module_image_height' => 16, + 'module_image_src' => '', + 'module_name' => 'foo', ), array( 'template' => 'foobar.html', 'title' => 'foo', 'code' => 'bar', + 'image_src' => '', )), array(array( 'module_column' => 1, 'module_id' => 1, 'module_image_width' => 16, 'module_image_height' => 16, + 'module_image_src' => '', + 'module_name' => 'foo', ), 'foobar.html'), ); } diff --git a/tests/unit/controller/main_test.php b/tests/unit/controller/main_test.php index ac799b37..775a4e7c 100644 --- a/tests/unit/controller/main_test.php +++ b/tests/unit/controller/main_test.php @@ -43,7 +43,13 @@ class main_test extends \board3\portal\tests\testframework\database_test_case $cache = new \phpbb\cache\driver\dummy(); - $user = new \board3\portal\tests\mock\user(); + $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); + $this->language = new \board3\portal\tests\mock\language($this->language_file_loader); + $this->language->set([ + 'S_PORTAL_ALL' => 'S_PORTAL_ALL', + ]); + $user = new \phpbb\user($this->language, '\phpbb\datetime'); + $user->style['style_path'] = 'prosilver'; $config_table = $table_prefix . 'portal_config'; $modules_table = $table_prefix . 'portal_modules'; @@ -61,8 +67,6 @@ class main_test extends \board3\portal\tests\testframework\database_test_case ->method('acl_get') ->with($this->anything()) ->will($this->returnValue(true)); - $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); - $this->language = new \phpbb\language\language($this->language_file_loader); $controller_helper = new \board3\portal\controller\helper( $auth, @@ -103,15 +107,35 @@ class main_test extends \board3\portal\tests\testframework\database_test_case $this->template->assert_same(true, 'S_PORTAL_ALL'); $this->template->delete_var('S_PORTAL_ALL'); $this->assertNull($this->controller_main->handle(array('left' => 1))); - $this->template->assert_same(null, 'S_PORTAL_ALL'); + $this->template->assert_not_exist('S_PORTAL_ALL'); } public function test_is_enabled_side_column() { - $this->assertFalse($this->controller_main->get_module_template(array(), new \board3\portal\modules\clock($this->config, $this->template))); + $this->assertFalse($this->controller_main->get_module_template( + [ + 'module_column' => 1, + 'module_id' => 1, + 'module_image_width' => 16, + 'module_image_height' => 16, + 'module_image_src' => '', + 'module_name' => 'foo', + ], + new \board3\portal\modules\clock($this->config, $this->template) + )); $this->assertNull($this->controller_main->handle(array('left' => 1))); $this->template->assert_same(true, 'S_PORTAL_ALL'); $this->config['board3_left_column'] = false; - $this->assertSame('clock_side.html', $this->controller_main->get_module_template(array('module_column' => 1), new \board3\portal\modules\clock($this->config, $this->template))); + $this->assertSame('clock_side.html', $this->controller_main->get_module_template( + [ + 'module_column' => 1, + 'module_id' => 1, + 'module_image_width' => 16, + 'module_image_height' => 16, + 'module_image_src' => '', + 'module_name' => 'foo', + ], + new \board3\portal\modules\clock($this->config, $this->template) + )); } } diff --git a/tests/unit/event/listener_test.php b/tests/unit/event/listener_test.php index a0dc3fc9..ad8225d1 100644 --- a/tests/unit/event/listener_test.php +++ b/tests/unit/event/listener_test.php @@ -122,8 +122,8 @@ class listener_test extends \phpbb_template_template_test_case ), new \phpbb\filesystem\filesystem(), new \phpbb_mock_request(), - $this->phpbb_root_path, - $this->php_ext + $phpbb_root_path, + $phpEx ); $this->controller = $this->getMockBuilder('\board3\portal\controller\main') @@ -212,6 +212,7 @@ class listener_test extends \phpbb_template_template_test_case $this->phpbb_dispatcher->addListener('core.page_header', array($this->listener, 'add_portal_link')); $this->controller_helper->set_current_url(''); + $vars = []; $result = $this->phpbb_dispatcher->trigger_event('core.page_header', compact($vars)); $this->assertEmpty($result); diff --git a/tests/unit/functions/check_file_src_test.php b/tests/unit/functions/check_file_src_test.php index 607b4a63..b7ca1ef8 100644 --- a/tests/unit/functions/check_file_src_test.php +++ b/tests/unit/functions/check_file_src_test.php @@ -19,7 +19,12 @@ class phpbb_functions_check_file_src_test extends \board3\portal\tests\testframe parent::setUp(); global $user; - $user = new phpbb_mock_user(); + $language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); + $language = new \board3\portal\tests\mock\language($language_file_loader); + $language->set([ + 'B3P_FILE_NOT_FOUND' => 'B3P_FILE_NOT_FOUND', + ]); + $user = new \phpbb\user($language, '\phpbb\datetime'); $portal_root_path = $phpbb_root_path . 'ext/board3/portal/'; } @@ -32,7 +37,7 @@ class phpbb_functions_check_file_src_test extends \board3\portal\tests\testframe public function test_check_file_src() { $this->assertFalse(check_file_src('portal_attach.png', '', 15, false)); - $this->assertEquals(': styles/all/theme/images/portal/portal_foobar.png
', check_file_src('portal_foobar.png', '', 15, false)); + $this->assertEquals('B3P_FILE_NOT_FOUND: styles/all/theme/images/portal/portal_foobar.png
', check_file_src('portal_foobar.png', '', 15, false)); } public function test_check_file_src_error() diff --git a/tests/unit/functions/fetch_news_test.php b/tests/unit/functions/fetch_news_test.php index 52dc1cef..03dda888 100644 --- a/tests/unit/functions/fetch_news_test.php +++ b/tests/unit/functions/fetch_news_test.php @@ -19,8 +19,11 @@ class phpbb_functions_fetch_news_test extends \board3\portal\tests\testframework { parent::setUp(); - global $auth, $cache, $phpbb_container, $phpbb_dispatcher, $template, $user, $phpbb_root_path, $phpEx; + global $auth, $cache, $config, $phpbb_container, $phpbb_dispatcher, $template, $user, $phpbb_root_path, $phpEx; + $config = new \phpbb\config\config([ + 'allow_nocensors' => false, + ]); $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); $this->language = new \phpbb\language\language($this->language_file_loader); $user = new \phpbb\user($this->language, '\phpbb\datetime'); @@ -54,7 +57,10 @@ class phpbb_functions_fetch_news_test extends \board3\portal\tests\testframework $auth = new \phpbb\auth\auth(); $userdata = array( 'user_id' => 2, + 'user_permissions' => '', + 'user_type' => USER_NORMAL, ); + $user->data['user_options'] = 0; $auth->acl($userdata); // Pretend to allow downloads $auth->acl[0][0] = true; @@ -198,6 +204,8 @@ class phpbb_functions_fetch_news_test extends \board3\portal\tests\testframework public function test_phpbb_fetch_news($type, $expected_columns, $expected_main_columns = array(), $number_of_posts = 5, $forum_from = '', $empty = false, $permissions = false, $invert = false, $text_length = 150, $expected_exception = false) { + global $phpbb_container; + $module_id = 5; $time = time(); $start = 0; @@ -207,7 +215,10 @@ class phpbb_functions_fetch_news_test extends \board3\portal\tests\testframework $this->expectException($expected_exception); } - $fetch_posts = phpbb_fetch_posts($module_id, $forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start, $invert); + $b3p_fetch_posts = $phpbb_container->get('board3.portal.fetch_posts'); + $b3p_fetch_posts->set_module_id($module_id); + + $fetch_posts = $b3p_fetch_posts->get_posts($forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start, $invert); if (!$empty) { @@ -257,24 +268,31 @@ class phpbb_functions_fetch_news_test extends \board3\portal\tests\testframework ->with($this->anything()) ->will($this->returnValue(array())); - $phpbb_container->set('board3.portal.fetch_posts', new \board3\portal\portal\fetch_posts($this->auth, $cache, $this->config, $this->db, $this->modules_helper, $this->user)); - $fetch_posts = phpbb_fetch_posts(5, '', false, 5, 150, time(), 'announcements'); + $b3p_fetch_posts = new \board3\portal\portal\fetch_posts($this->auth, $cache, $this->config, $this->db, $this->modules_helper, $this->user); + $b3p_fetch_posts->set_module_id(5); + $fetch_posts = $b3p_fetch_posts->get_posts('', false, 5, 150, time(), 'announcements'); $this->assertEmpty($fetch_posts); } public function test_no_allowed_forums() { - global $auth; + global $auth, $phpbb_container; $auth = new \phpbb\auth\auth(); - $fetch_posts = phpbb_fetch_posts(5, '2', true, 5, 150, time(), 'announcements'); + $b3p_fetch_posts = $phpbb_container->get('board3.portal.fetch_posts'); + $b3p_fetch_posts->set_module_id(5); + $fetch_posts = $b3p_fetch_posts->get_posts('2', true, 5, 150, time(), 'announcements'); $this->assertSame(array(), $fetch_posts); } public function test_number_replies() { - $fetch_posts = phpbb_fetch_posts(5, '', false, 5, 150, time(), 'news'); + global $phpbb_container; + + $b3p_fetch_posts = $phpbb_container->get('board3.portal.fetch_posts'); + $b3p_fetch_posts->set_module_id(5); + $fetch_posts = $b3p_fetch_posts->get_posts('', false, 5, 150, time(), 'news'); // Topic has 2 posts which means there is only one reply $this->assertEquals(1, $fetch_posts[0]['topic_replies']); $this->assertEquals(1, $fetch_posts[0]['topic_replies_real']); diff --git a/tests/unit/functions/fixtures/styles.xml b/tests/unit/functions/fixtures/styles.xml index 6cb30627..9d964f91 100644 --- a/tests/unit/functions/fixtures/styles.xml +++ b/tests/unit/functions/fixtures/styles.xml @@ -1,17 +1,20 @@ + style_idstyle_pathstyle_namestyle_activestyle_parent_tree + 2 subsilver2 subsilver2 0 + 1 prosilver prosilver 1 diff --git a/tests/unit/includes/helper_test.php b/tests/unit/includes/helper_test.php index 9f98cc7f..cd6c3a6c 100644 --- a/tests/unit/includes/helper_test.php +++ b/tests/unit/includes/helper_test.php @@ -15,9 +15,14 @@ class board3_includes_helper_test extends \board3\portal\tests\testframework\tes public function setUp(): void { + global $phpbb_root_path; + $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); + $this->language = new \board3\portal\tests\mock\language($this->language_file_loader); + $user = new \phpbb\user($this->language, '\phpbb\datetime'); + $config = new \phpbb\config\config(array()); $this->modules = array( - '\board3\portal\modules\link_us' => new \board3\portal\modules\link_us($config, new \board3\portal\tests\mock\template($this), new \board3\portal\tests\mock\user), + '\board3\portal\modules\link_us' => new \board3\portal\modules\link_us($config, new \board3\portal\tests\mock\template($this), $user), ); $this->portal_helper = $this->get_portal_helper($this->modules); diff --git a/tests/unit/modules/birthday_list_test.php b/tests/unit/modules/birthday_list_test.php index 0d32fb1a..3298f927 100644 --- a/tests/unit/modules/birthday_list_test.php +++ b/tests/unit/modules/birthday_list_test.php @@ -40,7 +40,10 @@ class phpbb_unit_modules_birthday_list_test extends \board3\portal\tests\testfra $this->template = new \board3\portal\tests\mock\template($this); $this->config = new \phpbb\config\config(array()); $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); - $this->language = new \phpbb\language\language($this->language_file_loader); + $this->language = new \board3\portal\tests\mock\language($this->language_file_loader); + $this->language->set([ + 'BIRTHDAYS_AHEAD' => 'BIRTHDAYS_AHEAD', + ]); $this->user = new \phpbb\user($this->language, '\phpbb\datetime'); $this->user->timezone = new \DateTimeZone('UTC'); $this->user->add_lang('common'); @@ -73,7 +76,6 @@ class phpbb_unit_modules_birthday_list_test extends \board3\portal\tests\testfra 'username' => 'foobar', 'username_clean' => 'foobar', 'user_birthday' => preg_replace('/([0-9]+)-([0-9])-([0-9]+)/', '$1- $2-$3', date('d-n-Y', time())), - 'user_id' => 2, 'user_permissions' => '', 'user_sig' => '', 'user_type' => USER_NORMAL, @@ -82,7 +84,6 @@ class phpbb_unit_modules_birthday_list_test extends \board3\portal\tests\testfra 'username' => 'foobar2', 'username_clean' => 'foobar2', 'user_birthday' => preg_replace('/([0-9]+)-([0-9])-([0-9]+)/', '$1- $2-$3', date('d-n-Y', time() + 86400 * 3)), - 'user_id' => 3, 'user_permissions' => '', 'user_sig' => '', 'user_type' => USER_NORMAL, diff --git a/tests/unit/modules/calendar_test.php b/tests/unit/modules/calendar_test.php index 6a390127..9a60d8e9 100644 --- a/tests/unit/modules/calendar_test.php +++ b/tests/unit/modules/calendar_test.php @@ -38,7 +38,7 @@ class phpbb_unit_modules_calendar_test extends \board3\portal\tests\testframewor public function setUp(): void { parent::setUp(); - global $cache, $phpbb_root_path, $phpEx, $phpbb_dispatcher, $request, $user; + global $cache, $config, $phpbb_root_path, $phpEx, $phpbb_dispatcher, $request, $user; $this->path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( @@ -57,7 +57,10 @@ class phpbb_unit_modules_calendar_test extends \board3\portal\tests\testframewor ->method('trigger_event') ->with($this->anything()) ->will($this->returnArgument(1)); - self::$config = new \phpbb\config\config(array()); + self::$config = new \phpbb\config\config([ + 'force_server_vars' => false, + ]); + $config = self::$config; \set_config('foobar', false, false, self::$config); $this->template = new \board3\portal\tests\mock\template($this); $controller_helper = new \board3\portal\tests\mock\controller_helper($phpbb_root_path, $phpEx); @@ -65,10 +68,16 @@ class phpbb_unit_modules_calendar_test extends \board3\portal\tests\testframewor $modules_helper = new \board3\portal\includes\modules_helper(new \phpbb\auth\auth(), new \phpbb\config\config(array()), $controller_helper, new \phpbb_mock_request()); $request = $this->request = new \phpbb_mock_request(); $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); - $this->language = new \phpbb\language\language($this->language_file_loader); + $this->language = new \board3\portal\tests\mock\language($this->language_file_loader); + $this->language->add_lang('common'); + $this->language->add_lang_ext('board3/portal', 'modules/portal_calendar_module'); $user = new \phpbb\user($this->language, '\phpbb\datetime'); + $user->data = [ + 'user_id' => 2, + 'user_ip' => '127.0.0.1', + 'user_dateformat' => 'dmY', + ]; $user->timezone = new \DateTimeZone('UTC'); - $user->add_lang('common'); $log = $this->getMockBuilder('\phpbb\log') ->setMethods(array('add')) ->disableOriginalConstructor() @@ -78,8 +87,6 @@ class phpbb_unit_modules_calendar_test extends \board3\portal\tests\testframewor ->with($this->anything()) ->will($this->returnValue(true)); $this->calendar = new \board3\portal\modules\calendar(self::$config, $modules_helper, $this->template, $db, $this->request, dirname(__FILE__) . '/../../../', 'php', $user, $this->path_helper, $log); - define('PORTAL_MODULES_TABLE', 'phpbb_portal_modules'); - define('PORTAL_CONFIG_TABLE', 'phpbb_portal_config'); $cache = $this->getMockBuilder('\phpbb\cache\driver\dummy') ->setMethods(['destroy', 'sql_exists', 'get', 'put']) ->getMock(); @@ -188,6 +195,7 @@ class phpbb_unit_modules_calendar_test extends \board3\portal\tests\testframewor public function test_update_events_no_error() { + set_portal_config('board3_calendar_events_5', '[]'); $this->calendar->update_events('foobar', 5); $this->assertNull($this->template->get_row('events')); } diff --git a/tests/unit/modules/clock_test.php b/tests/unit/modules/clock_test.php index 9db1bc15..14259863 100644 --- a/tests/unit/modules/clock_test.php +++ b/tests/unit/modules/clock_test.php @@ -32,7 +32,7 @@ class phpbb_unit_modules_clock_test extends \board3\portal\tests\testframework\t public function test_get_template_side() { $this->assertSame('clock_side.html', $this->clock->get_template_side(5)); - $this->template->assert_same(null, 'B3P_CLOCK_SRC'); + $this->template->assert_not_exist( 'B3P_CLOCK_SRC'); $this->config->set('board3_clock_src_5', 'foobar'); $this->assertSame('clock_side.html', $this->clock->get_template_side(5)); $this->template->assert_same('foobar', 'B3P_CLOCK_SRC'); diff --git a/tests/unit/modules/welcome_test.php b/tests/unit/modules/welcome_test.php index 18b548ff..9c4fbf5e 100644 --- a/tests/unit/modules/welcome_test.php +++ b/tests/unit/modules/welcome_test.php @@ -45,9 +45,10 @@ class phpbb_unit_modules_welcome_test extends \board3\portal\tests\testframework $request = $this->request; $this->template = new \board3\portal\tests\mock\template($this); $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); - $this->language = new \phpbb\language\language($this->language_file_loader); + $this->language = new \board3\portal\tests\mock\language($this->language_file_loader); $this->user = new \phpbb\user($this->language, '\phpbb\datetime'); $user = $this->user; + $user->data['user_options'] = 0; $cache = $this->getMockBuilder('\phpbb\cache\driver\dummy') ->setMethods(['destroy', 'sql_exists', 'get', 'put', 'sql_load']) ->getMock(); @@ -172,6 +173,7 @@ class phpbb_unit_modules_welcome_test extends \board3\portal\tests\testframework public function test_update_welcome() { + \set_portal_config('board3_welcome_message_' . 5, 'Welcome to my Community!'); $this->welcome->update_welcome('foobar', 5); $this->template->assert_same(true, 'S_EDIT'); $this->request->overwrite('preview', true, \phpbb\request\request_interface::POST); @@ -205,7 +207,7 @@ class phpbb_unit_modules_welcome_test extends \board3\portal\tests\testframework $this->welcome = new \board3\portal\modules\welcome($this->config, $this->request, $this->template, $this->user, '', ''); $this->request->overwrite('submit', true, \phpbb\request\request_interface::POST); $this->request->overwrite('welcome_message', ''); - $this->setExpectedTriggerError(E_USER_WARNING); + $this->setExpectedTriggerError(version_compare(PHP_VERSION, '8', '>=') ? E_WARNING : E_USER_WARNING); check_form_key::$form_key_valid = true; $this->welcome->update_welcome('foobar', 5); } diff --git a/tests/unit/portal/fetch_posts_test.php b/tests/unit/portal/fetch_posts_test.php index 02cd41ec..27c114b5 100644 --- a/tests/unit/portal/fetch_posts_test.php +++ b/tests/unit/portal/fetch_posts_test.php @@ -22,14 +22,17 @@ class phpbb_portal_fetch_posts_test extends \board3\portal\tests\testframework\d public function setUp(): void { - global $auth, $cache, $phpbb_dispatcher, $phpbb_root_path, $phpEx, $template, $user; + global $auth, $cache, $config, $phpbb_dispatcher, $phpbb_root_path, $phpEx, $template, $user; parent::setUp(); $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); $this->language = new \phpbb\language\language($this->language_file_loader); $user = new \phpbb\user($this->language, '\phpbb\datetime'); - $user->data['user_id'] = 2; + $user->data = [ + 'user_id' => 2, + 'user_options' => 0, + ]; $user->timezone = new \DateTimeZone('UTC'); $user->add_lang('common'); $user->add_lang('../../ext/board3/portal/language/en/portal'); @@ -54,10 +57,16 @@ class phpbb_portal_fetch_posts_test extends \board3\portal\tests\testframework\d ->with($this->anything()) ->will($this->returnArgument(2)); require_once(dirname(__FILE__) . '/../../../../../../includes/functions_content.php'); - $this->config = new \phpbb\config\config(array('allow_attachments' => 1)); + $this->config = new \phpbb\config\config([ + 'allow_attachments' => 1, + 'allow_smilies' => 1, + ]); + $config = $this->config; $auth = new \phpbb\auth\auth(); $userdata = array( 'user_id' => 2, + 'user_permissions' => '', + 'user_type' => USER_NORMAL, ); $auth->acl($userdata); // Pretend to allow downloads diff --git a/tests/unit/portal/modules_manager_confirm_box_test.php b/tests/unit/portal/modules_manager_confirm_box_test.php index 0b406222..141482b6 100644 --- a/tests/unit/portal/modules_manager_confirm_box_test.php +++ b/tests/unit/portal/modules_manager_confirm_box_test.php @@ -43,7 +43,10 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor parent::setUp(); - $user = new \board3\portal\tests\mock\user(); + $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); + $this->language = new \board3\portal\tests\mock\language($this->language_file_loader); + $this->language->add_lang_ext('board3/portal', 'portal_acp'); + $user = new \phpbb\user($this->language, '\phpbb\datetime'); $request =new \phpbb_mock_request(); $this->request = $request; $this->user = $user; @@ -58,12 +61,13 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor $this->portal_helper = new \board3\portal\includes\helper(array( new \board3\portal\modules\clock($config, null), new \board3\portal\modules\birthday_list($config, null, $this->db, $user), - new \board3\portal\modules\welcome($config, new \phpbb_mock_request, $this->db, $user, $this->phpbb_root_path, $this->phpEx), + new \board3\portal\modules\welcome($config, new \phpbb_mock_request, $this->db, $user, $phpbb_root_path, $phpEx), new \board3\portal\modules\donation($config, $this->request, null, $user, $modules_helper), )); $this->portal_columns = new \board3\portal\portal\columns(); - $this->cache = $this->getMockBuilder('\phpbb\cache\driver\dummy') + $this->cache = $this->getMockBuilder('\phpbb\cache\service') + ->disableOriginalConstructor() ->setMethods(['destroy', 'sql_exists', 'get', 'put', 'purge']) ->getMock(); $this->cache->expects($this->any()) @@ -83,11 +87,6 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor ->method('purge'); $cache = $this->cache; $db = $this->db; - $user->set(array( - 'UNABLE_TO_MOVE' => 'UNABLE_TO_MOVE', - 'UNABLE_TO_MOVE_ROW' => 'UNABLE_TO_MOVE_ROW', - 'SUCCESS_DELETE' => 'SUCCESS_DELETE', - )); $this->database_handler = new \board3\portal\portal\modules\database_handler($db); $this->constraints_handler = new \board3\portal\portal\modules\constraints_handler($this->portal_columns, $user); @@ -102,9 +101,6 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor $phpEx ); - $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); - $this->language = new \phpbb\language\language($this->language_file_loader); - $this->b3p_controller_helper = new \board3\portal\controller\helper( new \phpbb\auth\auth(), $this->portal_columns, @@ -127,7 +123,15 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor // Build confirm box first $this->modules_manager->set_u_action('adm/index.php?i=15&mode=foobar')->set_acp_class('foo\bar'); self::$confirm = false; - $this->assertNull($this->modules_manager->reset_module(15, 'barfoo', 6, array())); + $module_data = [ + 'module_column' => 1, + 'module_id' => 6, + 'module_image_width' => 16, + 'module_image_height' => 16, + 'module_image_src' => '', + 'module_name' => 'foo', + ]; + $this->assertNull($this->modules_manager->reset_module(15, 'barfoo', 6, $module_data)); $this->assertEquals(' @@ -137,19 +141,20 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor // Actually reset module phpbb_acp_move_module_test::$override_trigger_error = true; self::$confirm = true; - $this->assertNull($this->modules_manager->reset_module(15, 'barfoo', 6, array())); + $this->assertNull($this->modules_manager->reset_module(15, 'barfoo', 6, $module_data)); $this->assertEquals(array( 'seconds' => 3, 'link' => 'adm/index.php?i=-foo-bar&mode=config&module_id=6', ), self::$meta_refresh); - $this->assertEquals(phpbb_acp_move_module_test::$error_type, E_USER_NOTICE); - $this->assertEquals(phpbb_acp_move_module_test::$error, 'adm/index.php?i=15&mode=foobar&module_id=6'); + $this->assertEquals(E_USER_NOTICE, phpbb_acp_move_module_test::$error_type); + $this->assertEquals($this->language->lang('MODULE_RESET_SUCCESS') . 'adm/index.php?i=15&mode=foobar&module_id=6', phpbb_acp_move_module_test::$error); phpbb_acp_move_module_test::$override_trigger_error = false; } public function test_module_delete() { - $this->cache = $this->getMockBuilder('\phpbb\cache\driver\dummy') + $this->cache = $this->getMockBuilder('\phpbb\cache\service') + ->disableOriginalConstructor() ->setMethods(['destroy', 'sql_exists', 'get', 'put', 'purge']) ->getMock(); $this->cache->expects($this->any()) @@ -186,7 +191,7 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor modules_manager_confirm_box_test::$confirm = true; $this->assertNull($this->modules_manager->module_delete(6, 'foobar', 'module_delete', 6)); $this->assertEquals(E_USER_NOTICE, phpbb_acp_move_module_test::$error_type); - $this->assertEquals('SUCCESS_DELETEadm/index.php?i=15&mode=foobar', phpbb_acp_move_module_test::$error); + $this->assertEquals($this->language->lang('SUCCESS_DELETE'). 'adm/index.php?i=15&mode=foobar', phpbb_acp_move_module_test::$error); phpbb_acp_move_module_test::$override_trigger_error = false; } } diff --git a/tests/unit/portal/modules_manager_test.php b/tests/unit/portal/modules_manager_test.php index b0f7065d..8f06f80d 100644 --- a/tests/unit/portal/modules_manager_test.php +++ b/tests/unit/portal/modules_manager_test.php @@ -37,7 +37,9 @@ class board3_portal_modules_manager_test extends \board3\portal\tests\testframew parent::setUp(); - $user = new \board3\portal\tests\mock\user(); + $this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php'); + $this->language = new \board3\portal\tests\mock\language($this->language_file_loader); + $user = new \phpbb\user($this->language, '\phpbb\datetime'); $request =new \phpbb_mock_request(); $config = new \phpbb\config\config(array()); @@ -45,17 +47,18 @@ class board3_portal_modules_manager_test extends \board3\portal\tests\testframew $controller_helper = new \board3\portal\tests\mock\controller_helper($phpbb_root_path, $phpEx); $controller_helper->add_route('board3_portal_controller', 'portal'); - $modules_helper = new \board3\portal\includes\modules_helper($auth, $config, $controller_helper, $this->request); + $modules_helper = new \board3\portal\includes\modules_helper($auth, $config, $controller_helper, $request); $portal_helper = new \board3\portal\includes\helper(array( new \board3\portal\modules\clock($config, null), new \board3\portal\modules\birthday_list($config, null, $this->db, $user), - new \board3\portal\modules\welcome($config, new \phpbb_mock_request, $this->db, $user, $this->phpbb_root_path, $this->phpEx), + new \board3\portal\modules\welcome($config, new \phpbb_mock_request, $this->db, $user, $phpbb_root_path, $phpEx), new \board3\portal\modules\donation($config, $request, null, $user, $modules_helper), )); $this->portal_columns = new \board3\portal\portal\columns(); - $cache = $this->getMockBuilder('\phpbb\cache\driver\dummy') + $cache = $this->getMockBuilder('\phpbb\cache\service') + ->disableOriginalConstructor() ->setMethods(['destroy', 'sql_exists', 'get', 'put', 'sql_load', 'sql_save']) ->getMock(); $cache->expects($this->any()) @@ -80,7 +83,7 @@ class board3_portal_modules_manager_test extends \board3\portal\tests\testframew ->with($this->anything()) ->will($this->returnArgument(2)); $db = $this->db; - $user->set(array( + $this->language->set(array( 'UNABLE_TO_MOVE' => 'UNABLE_TO_MOVE', 'UNABLE_TO_MOVE_ROW' => 'UNABLE_TO_MOVE_ROW', )); @@ -108,7 +111,7 @@ class board3_portal_modules_manager_test extends \board3\portal\tests\testframew new \board3\portal\tests\mock\template($this), $user, $this->path_helper, - $this->portal_helper, + $portal_helper, $phpbb_root_path, $phpEx ); diff --git a/travis/prepare-coverage.sh b/travis/prepare-coverage.sh deleted file mode 100755 index 9b409088..00000000 --- a/travis/prepare-coverage.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This file is part of the Board3 Portal package. -# -# @copyright (c) Board3 Group -# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 -# -set -e -set -x - -DB=$1 -TRAVIS_PHP_VERSION=$2 - -if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysqli" ] -then - sed -n '1h;1!H;${;g;s/<\/php>/<\/php>\n\t\n\t\t\n\t\t\t..\/<\/directory>\n\t\t\t\n\t\t\t\t..\/tests\/<\/directory>\n\t\t\t\t..\/develop\/<\/directory>\n\t\t\t\t..\/migrations\/<\/directory>\n\t\t\t\t..\/language\/<\/directory>\n\t\t\t\t..\/vendor\/<\/directory>\n\t\t\t<\/exclude>\n\t\t<\/whitelist>\n\t<\/filter>/g;p;}' phpBB/ext/board3/portal/travis/phpunit-mysqli-travis.xml &> phpBB/ext/board3/portal/travis/phpunit-mysqli-travis.xml.bak - cp phpBB/ext/board3/portal/travis/phpunit-mysqli-travis.xml.bak phpBB/ext/board3/portal/travis/phpunit-mysqli-travis.xml -fi diff --git a/travis/prepare-phpbb.sh b/travis/prepare-phpbb.sh deleted file mode 100755 index 36128894..00000000 --- a/travis/prepare-phpbb.sh +++ /dev/null @@ -1,27 +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 - -# Clone trimmessage tool -git clone --depth=1 "git://github.com/nickvergessen/phpbb-tool-trimmessage.git" "phpBB3/phpBB/ext/nickvergessen/trimmessage" diff --git a/travis/run-epv.sh b/travis/run-epv.sh deleted file mode 100755 index 5c6aebda..00000000 --- a/travis/run-epv.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This file is part of the Board3 Portal package. -# -# @copyright (c) Board3 Group -# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 -# -set -e -set -x - -DB=$1 -TRAVIS_PHP_VERSION=$2 -EXTNAME=$3 - -if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysqli" ] -then - phpBB/ext/$EXTNAME/vendor/bin/EPV.php run --dir="phpBB/ext/$EXTNAME/" -fi diff --git a/travis/run-testsuite.sh b/travis/run-testsuite.sh deleted file mode 100755 index 2c80576e..00000000 --- a/travis/run-testsuite.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# -# This file is part of the Board3 Portal package. -# -# @copyright (c) Board3 Group -# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 -# -set -e -set -x - -DB=$1 -TRAVIS_PHP_VERSION=$2 - -if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysqli" ] -then - phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php --coverage-clover build/logs/clover.xml -else - phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php -fi diff --git a/travis/send-coverage.sh b/travis/send-coverage.sh deleted file mode 100755 index e0c3cb99..00000000 --- a/travis/send-coverage.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# -# This file is part of the Board3 Portal package. -# -# @copyright (c) Board3 Group -# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 -# -set -e -set -x - -DB=$1 -TRAVIS_PHP_VERSION=$2 - -if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysqli" ] -then - cd ../board3/Board3-Portal - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --access-token="681b2ead2ea75fe4ce287bae485a916f47034c76f39209a9397545058e7c045e" --format=php-clover ../../phpBB3/build/logs/clover.xml -fi