Skip to content

Commit

Permalink
Fix PHP_MAXPATHLEN test
Browse files Browse the repository at this point in the history
This test was incorrect because it does not take into account the paths that are prefixed in the FileViewFinder. This means that we have so far tested a path that is significantly longer than `PHP_MAXPATHLEN`. As we cannot reliably access the path, we approach `PHP_MAXPATHLEN` and test all file names from `PHP_MAXPATHLEN - 200` to `PHP_MAXPATHLEN + 1`.
  • Loading branch information
joshuaruesweg committed Jun 20, 2024
1 parent 02a0b5f commit 12e51dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/Integration/View/BladeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ public function test_rendering_blade_long_maxpathlen_string_with_exact_length()
$this->assertNotFalse($iniSet, 'Could not set config for open_basedir.');
}

$longString = str_repeat('x', PHP_MAXPATHLEN);
for ($i = PHP_MAXPATHLEN - 200; $i <= PHP_MAXPATHLEN + 1; $i++) {
$longString = str_repeat('x', $i);

$result = Blade::render($longString);
$result = Blade::render($longString);

$this->assertSame($longString, $result);
$this->assertSame($longString, $result);
}
}

public function test_rendering_blade_component_instance()
Expand Down

0 comments on commit 12e51dd

Please sign in to comment.