Skip to content

Commit

Permalink
Try to add windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Feb 19, 2024
1 parent d267df9 commit 0929cda
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:

jobs:
test:
name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }}
runs-on: ubuntu-latest
name: PHP ${{ matrix.runner }} + ${{ matrix.php-version }} + ${{ matrix.dependencies }}
runs-on: ${{ matrix.runner }}

env:
SYMFONY_REQUIRE: ${{matrix.symfony-require}}
Expand All @@ -22,13 +22,20 @@ 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.*
- php-version: 8.2
dependencies: highest
runner: windows-latest
- php-version: 8.2
dependencies: highest
runner: macos-latest

steps:
- name: Checkout
Expand Down
10 changes: 8 additions & 2 deletions tests/File/FileHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand Down Expand Up @@ -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__));
}

/**
Expand Down

0 comments on commit 0929cda

Please sign in to comment.