update project
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace Tests\Architecture;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
final class Phase5StudentLifecycleArchitectureTest extends TestCase { private function phpFiles(string $path): array { $base=dirname(__DIR__,2).'/'.$path; if(!is_dir($base)){return [];} $it=new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($base)); $files=[]; foreach($it as $f){ if($f->isFile()&&$f->getExtension()==='php'){$files[]=$f->getPathname();} } return $files; } public function test_school_core_students_does_not_depend_on_islamic_sunday_school(): void { foreach($this->phpFiles('app/Domain/SchoolCore/Students') as $file){$this->assertStringNotContainsString('App\\Domain\\IslamicSundaySchool',file_get_contents($file),$file);} } public function test_school_core_students_does_not_depend_on_request_or_auth(): void { foreach($this->phpFiles('app/Domain/SchoolCore/Students') as $file){$c=file_get_contents($file); $this->assertStringNotContainsString('Illuminate\\Http\\Request',$c,$file); $this->assertStringNotContainsString('auth()',$c,$file); $this->assertStringNotContainsString('request()',$c,$file);} } public function test_core_student_contracts_stay_neutral(): void { foreach($this->phpFiles('app/Domain/SchoolCore/Students/Contracts') as $file){$c=strtolower(file_get_contents($file)); foreach(['masjid','quran','arabic','halaqa','ministry','community','islamic_studies'] as $word){$this->assertStringNotContainsString($word,$c,$file);}} } }
|
||||
Reference in New Issue
Block a user