Skip to content

Commit 5f8ea6a

Browse files
minor #62137 [FrameworkBundle] Fix test on read-only directory on Windows (GromNaN)
This PR was merged into the 7.4 branch. Discussion ---------- [FrameworkBundle] Fix test on read-only directory on Windows | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT [`mkdir`](https://www.php.net/manual/en/function.mkdir.php)'s permissions is ignored on Windows. Use a Windows command to make the directory read-only. Fix the [job](https://github.com/symfony/symfony/actions/runs/18751945876/job/53493659812#step:7:1603): ``` 1) Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\PhpConfigReferenceDumpPassTest::testProcessIgnoresFileWriteErrors Failed asserting that file "C:\Users\RUNNER~1\AppData\Local\Temp/sf_test_config_reference/readonly/reference.php" does not exist. D:\a\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\PhpConfigReferenceDumpPassTest.php:76 ``` Commits ------- 76ad3872647 [FrameworkBundle] Fix test on read-only directory on Windows
2 parents ffd4876 + 5a3428a commit 5f8ea6a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Tests/DependencyInjection/Compiler/PhpConfigReferenceDumpPassTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ public function testProcessWithConfigDir()
6161

6262
public function testProcessIgnoresFileWriteErrors()
6363
{
64+
if ('\\' === \DIRECTORY_SEPARATOR) {
65+
self::markTestSkipped('Cannot reliably make directory read-only on Windows.');
66+
}
67+
6468
// Create a read-only directory to simulate write errors
6569
$readOnlyDir = $this->tempDir.'/readonly';
6670
mkdir($readOnlyDir, 0o444, true);

0 commit comments

Comments
 (0)