Files
laravel_school_api/tests/Architecture/Phase6CommunicationArchitectureTest.php
2026-05-30 01:11:35 -04:00

1 line
1.1 KiB
PHP

<?php declare(strict_types=1); namespace Tests\Architecture; use PHPUnit\Framework\TestCase; final class Phase6CommunicationArchitectureTest extends TestCase { public function test_school_core_communication_has_no_extension_import(): void { $it=new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(__DIR__.'/../../app/Domain/SchoolCore/Communication')); foreach($it as $file){ if(!$file->isFile()||$file->getExtension()!=='php') continue; $c=file_get_contents($file->getPathname()); $this->assertStringNotContainsString('App\\Domain\\IslamicSundaySchool',$c,$file->getPathname()); $this->assertStringNotContainsString('Illuminate\\Http\\Request',$c,$file->getPathname()); $this->assertStringNotContainsString('auth()',$c,$file->getPathname()); $this->assertStringNotContainsString('request()',$c,$file->getPathname()); } } public function test_core_contracts_are_neutral(): void { foreach(glob(__DIR__.'/../../app/Domain/SchoolCore/Communication/Contracts/*.php')?:[] as $file){ $c=strtolower(file_get_contents($file)); foreach(['sunday','masjid','ministry','halaqa','quran'] as $word){ $this->assertStringNotContainsString($word,$c,$file); } } } }