findPatternMatchesInPhpFiles('tests', '/\\$GLOBALS\\[\'minty_app_container\'\\]\\s*=/'), $this->findPatternMatchesInPhpFiles('tests', '/unset\\(\\$GLOBALS\\[\'minty_app_container\'\\]\\)/') ); $allowed = [ 'tests/Support/AppContainerIsolationTrait.php', ]; $violations = array_values(array_filter( array_unique($violations), static fn (string $path): bool => !in_array($path, $allowed, true) )); sort($violations); self::assertSame([], $violations, "Direct global app-container writes found outside isolation trait:\n" . implode("\n", $violations)); } }