first commit
This commit is contained in:
34
tests/Architecture/ModuleStructureTest.php
Normal file
34
tests/Architecture/ModuleStructureTest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Architecture;
|
||||
|
||||
use Tests\Architecture\Support\ArchitectureTestCase;
|
||||
|
||||
final class ModuleStructureTest extends ArchitectureTestCase
|
||||
{
|
||||
public function testFeatureModulesUseExpectedTopLevelStructure(): void
|
||||
{
|
||||
foreach (self::FEATURE_MODULES as $module) {
|
||||
$modulePath = $this->modulePath($module);
|
||||
self::assertDirectoryExists($modulePath, $this->moduleRuleMessage(self::MESSAGE_MODULE_DIRECTORY_MISSING, $module));
|
||||
|
||||
$entries = array_values(array_filter(scandir($modulePath) ?: [], static fn (string $entry): bool => !in_array($entry, ['.', '..'], true)));
|
||||
sort($entries);
|
||||
|
||||
self::assertSame($this->expectedModuleEntries($module), $entries, $this->moduleRuleMessage(self::MESSAGE_STANDARD_MODULE_STRUCTURE, $module));
|
||||
}
|
||||
}
|
||||
|
||||
public function testLegacyGlobalViewsDirectoryHasBeenRemoved(): void
|
||||
{
|
||||
self::assertDirectoryDoesNotExist($this->projectPath('views'));
|
||||
}
|
||||
|
||||
public function testFixtureApplicationExposesAModuleManifest(): void
|
||||
{
|
||||
self::assertDirectoryExists($this->projectPath('tests/Fixtures/Application/config'));
|
||||
self::assertFileExists($this->projectPath('tests/Fixtures/Application/config/modules.php'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user