[8.x] Allow the use of temporary views for Blade testing on Windows machines #37044
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For testing simple Blade strings, there is a
blade
function that creates a temporary file containing some strings content. This procedure breaks on Windows, as the created file receives a.tmp
extension (e.g.lar0000.tmp
). As the view name resolver replaces dots in view names with directory separators (as they are considered to be in some nested directory structure), the resolver searches for wrong path on Windows (e.g.%TEMP%/lar0000/tmp.blade.php
).This PR uses the filename (from
pathinfo
) rather than the basename as view name and filename, hence also works on Windows machines.