* */ class iTopNPMTest extends ItopTestCase { protected function setUp(): void { parent::setUp(); clearstatcache(); } /** * This is NOT a unit test, this test the iTop instance running the test ... */ public function testAllFoldersCovered() { $oDependenciesHandler = new iTopNPM(); $aAllowedAndDeniedDirs = array_merge( $oDependenciesHandler->ListAllowedFilesAbsPaths(), $oDependenciesHandler->ListDeniedFilesAbsPaths() ); $aExistingDirs = $oDependenciesHandler->ListAllFilesAbsPaths(); $aMissing = array_diff($aExistingDirs, $aAllowedAndDeniedDirs); $aExtra = array_diff($aAllowedAndDeniedDirs, $aExistingDirs); $this->assertEmpty( $aMissing, 'Test dirs exists in /node_modules !'."\n" .' They must be declared either in the allowed or denied list in '.iTopNPM::class." (see N°2651).\n" .' List of dirs:'."\n".var_export($aMissing, true) ); } }