27 lines
767 B
PHP
27 lines
767 B
PHP
<?php
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
it('has valid module manifests', function (): void {
|
|
$manifests = glob(base_path('Modules/*/module.json')) ?: [];
|
|
|
|
expect($manifests)->not->toBeEmpty();
|
|
|
|
foreach ($manifests as $manifest) {
|
|
$decoded = json_decode((string) file_get_contents($manifest), true, 512, JSON_THROW_ON_ERROR);
|
|
|
|
expect($decoded)
|
|
->toBeArray()
|
|
->toHaveKey('name')
|
|
->toHaveKey('providers');
|
|
|
|
expect($decoded['name'])->toBeString()->not->toBeEmpty();
|
|
expect($decoded['providers'])->toBeArray();
|
|
|
|
foreach ($decoded['providers'] as $provider) {
|
|
expect($provider)->toBeString();
|
|
expect(Str::contains($provider, '\\'))->toBeTrue();
|
|
}
|
|
}
|
|
});
|