diff --git a/.github/workflows/test-os.yaml b/.github/workflows/test-os.yaml new file mode 100644 index 00000000..644231cd --- /dev/null +++ b/.github/workflows/test-os.yaml @@ -0,0 +1,56 @@ +name: Test OS + +on: + push: + branches: + - main + pull_request: + +jobs: + test-windows: + name: Windows + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + tools: composer:v2 + ini-file: development + + - name: Install Composer dependencies + uses: ramsey/composer-install@v2 + with: + dependency-versions: highest + composer-options: --prefer-dist --prefer-stable + + - name: Run tests with PHPUnit + run: vendor/bin/phpunit + + test-macos: + name: Mac OS + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + tools: composer:v2 + ini-file: development + + - name: Install Composer dependencies + uses: ramsey/composer-install@v2 + with: + dependency-versions: highest + composer-options: --prefer-dist --prefer-stable + + - name: Run tests with PHPUnit + run: vendor/bin/phpunit diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3e1f9d9f..b9beb9b6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,7 +8,7 @@ on: jobs: test: - name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }} + name: PHP ${{ matrix.runner }} + ${{ matrix.php-version }} + ${{ matrix.dependencies }} runs-on: ubuntu-latest env: @@ -22,11 +22,12 @@ jobs: - 8.2 - 8.3 dependencies: [highest] + runner: [ubuntu-latest] symfony-require: [''] include: - php-version: 8.0 dependencies: lowest - - php-version: '8.2' + - php-version: 8.2 dependencies: highest symfony-require: 7.0.* diff --git a/tests/File/FileHelperTest.php b/tests/File/FileHelperTest.php index 9e2f6172..f31671af 100644 --- a/tests/File/FileHelperTest.php +++ b/tests/File/FileHelperTest.php @@ -41,6 +41,9 @@ public function testGetFileName( ?string $expected, ): void { static::assertSame($expected, FileHelper::getFileName($path, $baseDir, $ignoredDir)); + + $windowsPath = str_replace('/', '\\', $path); + static::assertSame($expected, FileHelper::getFileName($windowsPath, $baseDir, $ignoredDir)); } /** @@ -99,12 +102,15 @@ public static function getFileNameDataProvider(): iterable * @dataProvider getDirectoriesDataProvider */ public function testGetDirectories( - string $absolutePath, + string $path, ?string $baseDir, array $ignoredDir, array $expected, ): void { - static::assertSame($expected, FileHelper::getDirectories($absolutePath, $baseDir, $ignoredDir, __DIR__)); + static::assertSame($expected, FileHelper::getDirectories($path, $baseDir, $ignoredDir, __DIR__)); + + $windowsPath = str_replace('/', '\\', $path); + static::assertSame($expected, FileHelper::getDirectories($windowsPath, $baseDir, $ignoredDir, __DIR__)); } /**