MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / test_prefix_without_trailing_backslash

Function test_prefix_without_trailing_backslash

tests/unit/composer.rs:379–400  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

377
378#[test]
379fn test_prefix_without_trailing_backslash() {
380 let ws = TestWorkspace::new(
381 r#"{
382 "autoload": {
383 "psr-4": {
384 "App": "src/"
385 }
386 }
387 }"#,
388 );
389 ws.create_php_file(
390 "src/Service.php",
391 "<?php\nnamespace App;\nclass Service {}\n",
392 );
393
394 let (mappings, _vendor_dir) = parse_composer_json(ws.root());
395 // The prefix gets normalised to "App\"
396 assert_eq!(mappings[0].prefix, "App\\");
397
398 let result = resolve_class_path(&mappings, ws.root(), "App\\Service");
399 assert!(result.is_some());
400}
401
402// ─── parse_autoload_files Tests ─────────────────────────────────────────────
403

Callers

nothing calls this directly

Calls 4

parse_composer_jsonFunction · 0.85
resolve_class_pathFunction · 0.85
create_php_fileMethod · 0.80
rootMethod · 0.80

Tested by

no test coverage detected