()
| 377 | |
| 378 | #[test] |
| 379 | fn 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 |
nothing calls this directly
no test coverage detected