Skip to content

Commit

Permalink
Make implementation windows safe
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurt Friars committed Nov 21, 2023
1 parent ceaee5c commit e37371c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@

function setBladePath(string $path = ''): void
{
$fixtures = str(realpath(__DIR__).'/Helper/Blade/')
$fixtures = str(realpath(__DIR__).DIRECTORY_SEPARATOR.'Helper'.DIRECTORY_SEPARATOR.'Blade'.DIRECTORY_SEPARATOR)
->append($path)
->rtrim('/')
->explode('/');
->rtrim(DIRECTORY_SEPARATOR)
->explode(DIRECTORY_SEPARATOR);

$folder = $fixtures->pop();
$path = $fixtures->implode('/');
$path = $fixtures->implode(DIRECTORY_SEPARATOR);

config()->set('view.paths', [$path]);
config()->set('contentable.layouts.folder', $folder);
}

function setInertiaPath(string $path = ''): void
{
$fixtures = str(realpath(__DIR__).'/Helper/Inertia/')
$fixtures = str(realpath(__DIR__).DIRECTORY_SEPARATOR.'Helper'.DIRECTORY_SEPARATOR.'Inertia'.DIRECTORY_SEPARATOR)
->append($path)
->rtrim('/')
->explode('/');
->rtrim(DIRECTORY_SEPARATOR)
->explode(DIRECTORY_SEPARATOR);

$folder = $fixtures->pop();
$path = $fixtures->implode('/');
$path = $fixtures->implode(DIRECTORY_SEPARATOR);

$targetPath = resource_path('js');
$targetFolder = $targetPath.'/Pages';
$targetFolder = $targetPath.DIRECTORY_SEPARATOR.'Pages';

if (! file_exists($targetPath)) {
mkdir($targetPath, 0755, true);
Expand Down

0 comments on commit e37371c

Please sign in to comment.