From 418569d49ad1759d351ffe0fe419c0977568d5a2 Mon Sep 17 00:00:00 2001 From: Mathieu Dubois Date: Mon, 2 Sep 2024 21:30:33 +0200 Subject: [PATCH 1/6] Convert Travis tests to GitHub actions The test suite itself is not changed. For now we test only on Ubuntu and macOS because we need sudo. --- .github/workflows/main.yaml | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/main.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..70ba8dc --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,49 @@ +name: Main + +on: + workflow_dispatch: + push: + branches: + - main + - master + - release/** + pull_request: + branches: + - main + - master + - release/** + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: ['ubuntu-latest', 'macos-latest'] #, 'windows-latest'] + php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + steps: + - name: Get source code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + coverage: none + ini-values: post_max_size=256M, max_execution_time=180 + - run: sudo pear list + - run: sudo pear channel-update pear.php.net + - run: sudo pear upgrade --force pear/pear + - run: sudo pear list + - run: sudo pear install --force package.xml + - run: sudo pear list + - run: sudo pear package + - run: sudo pear package-validate + - run: sudo pear install --force *.tgz + - run: sudo pear list + - run: composer install + - run: ./vendor/bin/phpunit -c phpunit.xml.dist From e95446d69b8bb84dfd8a35a93ae7806f3891de90 Mon Sep 17 00:00:00 2001 From: Mathieu Dubois Date: Mon, 2 Sep 2024 22:31:58 +0200 Subject: [PATCH 2/6] Delete Travis file --- .travis.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 083af02..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: php -sudo: false -php: - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - - 7.4 -# Disable xdebug for PHP >= 7.3 -# https://stackoverflow.com/questions/65172031/vendor-bin-phpunit-exited-with-2 -before_script: - - phpenv config-rm xdebug.ini -script: - - pear list - - pear channel-update pear.php.net - - pear upgrade --force pear/pear - - pear list - - pear install --force package.xml - - pear list - - pear package - - pear package-validate - - pear install --force *.tgz - - pear list - - composer install - - ./vendor/bin/phpunit -c phpunit.xml.dist From ca1c19c2a150faef7561fb580a5aca2fb9ec41df Mon Sep 17 00:00:00 2001 From: Mathieu Dubois Date: Fri, 11 Oct 2024 23:32:17 +0200 Subject: [PATCH 3/6] Remove PHPUnit configuration file and update CI The file is deprecated for recent PHPUnit. --- .github/workflows/main.yaml | 2 +- phpunit.xml.dist | 29 ----------------------------- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 phpunit.xml.dist diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 70ba8dc..793ab95 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -46,4 +46,4 @@ jobs: - run: sudo pear install --force *.tgz - run: sudo pear list - run: composer install - - run: ./vendor/bin/phpunit -c phpunit.xml.dist + - run: ./vendor/bin/phpunit tests diff --git a/phpunit.xml.dist b/phpunit.xml.dist deleted file mode 100644 index 31c5c11..0000000 --- a/phpunit.xml.dist +++ /dev/null @@ -1,29 +0,0 @@ - - - - - tests/ - - - - - - HTML/ - - - - - - - - - From 59ac9a53ebffe244fb9fb2a0432c8a571f0f47a5 Mon Sep 17 00:00:00 2001 From: Mathieu Dubois Date: Fri, 13 Sep 2024 22:57:35 +0200 Subject: [PATCH 4/6] Port test suite to PHPUnitPolyFills This implies to delete AllTests.php --- composer.json | 2 +- package.xml | 1 - tests/AllTests.php | 34 ---------------------------------- tests/ITTest.php | 9 ++++++--- tests/ITXTest.php | 2 +- 5 files changed, 8 insertions(+), 40 deletions(-) delete mode 100644 tests/AllTests.php diff --git a/composer.json b/composer.json index fd97b87..4f5ded2 100644 --- a/composer.json +++ b/composer.json @@ -47,6 +47,6 @@ "pear/pear-core-minimal": "^1.10.1" }, "require-dev": { - "phpunit/phpunit": "^4" + "yoast/phpunit-polyfills": "^2.0" } } diff --git a/package.xml b/package.xml index 970e7dd..ce236f9 100644 --- a/package.xml +++ b/package.xml @@ -60,7 +60,6 @@ There are two classes to use for templating. HTML_Template_IT is used for basic - diff --git a/tests/AllTests.php b/tests/AllTests.php deleted file mode 100644 index 0059556..0000000 --- a/tests/AllTests.php +++ /dev/null @@ -1,34 +0,0 @@ -addTestSuite('ITTest'); - $suite->addTestSuite('ITXTest'); - - return $suite; - } -} - -if (PHPUnit_MAIN_METHOD == 'HTML_Template_IT_AllTests::main') { - HTML_Template_IT_AllTests::main(); -} -?> diff --git a/tests/ITTest.php b/tests/ITTest.php index ac95752..8854317 100644 --- a/tests/ITTest.php +++ b/tests/ITTest.php @@ -1,7 +1,10 @@ tpl = new HTML_Template_IT(dirname(__FILE__) . '/templates'); } - function tearDown() + protected function tear_down() { unset($this->tpl); } diff --git a/tests/ITXTest.php b/tests/ITXTest.php index 87f19c2..f5a728c 100644 --- a/tests/ITXTest.php +++ b/tests/ITXTest.php @@ -23,7 +23,7 @@ static function _numberFormatCallback($float, $decimals) class ITXTest extends ITTest { - function setUp() + function set_up() { $this->tpl = new HTML_Template_ITX(dirname(__FILE__) . '/templates'); } From eb68642cd45c314f2862a34dac02290f2158029c Mon Sep 17 00:00:00 2001 From: Mathieu Dubois Date: Fri, 13 Sep 2024 23:06:08 +0200 Subject: [PATCH 5/6] Add PHP versions from 8.0 to 8.3 --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 793ab95..3bd4e08 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -23,7 +23,7 @@ jobs: strategy: matrix: operating-system: ['ubuntu-latest', 'macos-latest'] #, 'windows-latest'] - php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] steps: - name: Get source code uses: actions/checkout@v4 From c23d5a430d74fb67f947dcfc7858945e4de6da34 Mon Sep 17 00:00:00 2001 From: Mathieu Dubois Date: Sun, 15 Sep 2024 11:09:20 +0200 Subject: [PATCH 6/6] Add a bit of comments --- tests/ITTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/ITTest.php b/tests/ITTest.php index 8854317..2e8616f 100644 --- a/tests/ITTest.php +++ b/tests/ITTest.php @@ -1,5 +1,10 @@