Skip to content

Commit

Permalink
Merge pull request #46 from driehle/hotfix/glob-brace
Browse files Browse the repository at this point in the history
Fix wrong negation in `Glob::glob()` introduced with 3.6.3
  • Loading branch information
snapshotpl authored Dec 29, 2021
2 parents abba193 + 54cb9f8 commit 830a36d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
id: matrix
uses: laminas/laminas-ci-matrix-action@v1

qa:
qa-ubuntu:
name: QA Checks
needs: [matrix]
runs-on: ${{ matrix.operatingSystem }}
Expand All @@ -30,4 +30,32 @@ jobs:
- name: ${{ matrix.name }}
uses: laminas/laminas-continuous-integration-action@v1
with:
job: ${{ matrix.job }}
job: ${{ matrix.job }}

qa-alpine:
name: QA Checks (PHPUnit on PHP 8.1 with Alpine Linux)
runs-on: ubuntu-latest
container:
image: php:8.1-alpine
steps:
- name: Show Alpine and PHP versions
run: |
cat /etc/os-release
php -v
- name: Install packages and PHP extensions
run: |
apk add git oniguruma-dev libxml2-dev
docker-php-ext-install mbstring
docker-php-ext-install xml
- name: Checkout
uses: actions/checkout@v2
- name: Install composer
run: |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
- name: Install latest dependencies
run: php composer.phar update --ignore-platform-req=php
- name: PHPUnit
run: ./vendor/bin/phpunit
2 changes: 1 addition & 1 deletion src/Glob.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected static function systemGlob($pattern, $flags)
*/
protected static function fallbackGlob($pattern, $flags)
{
if (self::flagsIsEqualTo($flags, self::GLOB_BRACE)) {
if (! self::flagsIsEqualTo($flags, self::GLOB_BRACE)) {
return static::systemGlob($pattern, $flags);
}

Expand Down
17 changes: 17 additions & 0 deletions test/StringWrapper/IconvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

use function array_shift;
use function extension_loaded;
use function file_exists;
use function file_get_contents;
use function is_readable;
use function stripos;

class IconvTest extends CommonStringWrapperTest
{
Expand All @@ -24,6 +28,19 @@ protected function setUp(): void
}
}

/**
* ext-iconv is not properly supported on Alpine Linux, hence, we skip the tests for now
*
* @see https://github.com/nunomaduro/phpinsights/issues/43
* @see https://github.com/docker-library/php/issues/240#issuecomment-353678474
*/
if (file_exists('/etc/os-release') && is_readable('/etc/os-release')) {
$osRelease = file_get_contents('/etc/os-release');
if (stripos($osRelease, 'Alpine Linux') !== false) {
$this->markTestSkipped('iconv not properly supported on Alpine Linux');
}
}

parent::setUp();
}

Expand Down

0 comments on commit 830a36d

Please sign in to comment.