Skip to content

Commit

Permalink
Merge pull request #95 from savannabits/4.x-dev
Browse files Browse the repository at this point in the history
Attempt 2: Test if convertPathToNamespace is fixed
  • Loading branch information
coolsam726 authored Apr 19, 2024
2 parents 192edbf + 35bdd93 commit 8028f6c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Unit/ModulesSingletonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

test('can convert path to namespace correctly', function () {
$path = DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'Providers' . DIRECTORY_SEPARATOR . 'AppServiceProvider.php';

$path = config('modules.paths.modules') . '/app/Providers/TestServiceProvider.php';
$namespace = FilamentModules::convertPathToNamespace($path);
expect($namespace)->toBe($expected = 'Modules\\Providers\\AppServiceProvider', "Expected $expected Instead got " . $namespace);
expect($namespace)->toBe($expected = 'Modules\\Providers\\TestServiceProvider', "Expected $expected Instead got " . $namespace);
});

0 comments on commit 8028f6c

Please sign in to comment.