diff --git a/.github/workflows/alpine.dockerfile b/.github/workflows/alpine.dockerfile new file mode 100644 index 0000000..1c5cfc9 --- /dev/null +++ b/.github/workflows/alpine.dockerfile @@ -0,0 +1,3 @@ +ARG PHP_VERSION +FROM php:${PHP_VERSION}-cli-alpine +COPY . . diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 4bc9a92..9b8252d 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -60,3 +60,15 @@ jobs: - name: "Tests" run: "vendor/bin/phpunit" + + - name: "Build Alpine image" + if: ${{ matrix.operating-system == 'ubuntu-latest' }} + run: docker build + --file .github/workflows/alpine.dockerfile + --build-arg PHP_VERSION=${{ matrix.php-version }} + --tag testenv + . + + - name: "Test under Alpine" + if: ${{ matrix.operating-system == 'ubuntu-latest' }} + run: docker run testenv vendor/bin/phpunit diff --git a/src/Iterator/GlobIterator.php b/src/Iterator/GlobIterator.php index e88bbeb..2ef80f8 100644 --- a/src/Iterator/GlobIterator.php +++ b/src/Iterator/GlobIterator.php @@ -52,7 +52,8 @@ public function __construct($glob, $flags = 0) // glob() does not support [^...] on Windows ('\\' !== DIRECTORY_SEPARATOR || false === strpos($glob, '[^')) ) { - $results = glob($glob, GLOB_BRACE); + // GLOB_BRACE is not available in some environments. + $results = glob($glob, defined('GLOB_BRACE') ? GLOB_BRACE : 0); // $results may be empty or false if $glob is invalid if (empty($results)) {