Skip to content

Commit

Permalink
Merge pull request #275 from hungtrinh/github-actions-phpunit-on-php82
Browse files Browse the repository at this point in the history
GitHub actions phpunit on php 8.2 & Fix bug on php 8.2
  • Loading branch information
glensc authored Nov 16, 2022
2 parents af92d85 + a919093 commit bc1be9c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ name: PHPUnit-9
on: [push, pull_request]

jobs:
phpunit-php82:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download phpunit
run: |
wget -O phpunit https://phar.phpunit.de/phpunit-9.5.26.phar
chmod +x phpunit
shell: bash
- name: PHPUnit 9 on php 8.2
uses: docker://php:8.2-rc-cli-alpine
with:
args: -d memory_limit=-1 ./phpunit --bootstrap tests/TestHelper.php tests/Zend/AllTests.php
phpunit-php81:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/LocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected function tearDown(): void
$locales = [];
foreach (explode(';', $this->_locale) as $l) {
$tmp = explode('=', $l);
$locales[$tmp[0]] = $tmp[1];
$locales[$tmp[0]] = count($tmp) > 1 ? $tmp[1] : $tmp[0];
}
setlocale(LC_ALL, $locales);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
function firstOne()
{
$substitute = "Testing";
$varA = "${substitute} 123!";
$varA = "{$substitute} 123!";
$varB = "{$substitute} 123!";
$varC = "$substitute 123!";
$varD = "${substitute}";
$varD = "{$substitute}";
}

function secondOne()
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Validate/FloatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function tearDown(): void
$locales = [];
foreach (explode(';', $this->_locale) as $l) {
$tmp = explode('=', $l);
$locales[$tmp[0]] = $tmp[1];
$locales[$tmp[0]] = count($tmp) > 1 ? $tmp[1] : $tmp[0];
}
setlocale(LC_ALL, $locales);
return;
Expand Down

0 comments on commit bc1be9c

Please sign in to comment.