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

Function test_parse_autoload_dev

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

Source from the content-addressed store, hash-verified

53
54#[test]
55fn test_parse_autoload_dev() {
56 let ws = TestWorkspace::new(
57 r#"{
58 "autoload": {
59 "psr-4": {
60 "Klarna\\": "src/Klarna/"
61 }
62 },
63 "autoload-dev": {
64 "psr-4": {
65 "Klarna\\Rest\\Tests\\": "tests/"
66 }
67 }
68 }"#,
69 );
70
71 let (mappings, _vendor_dir) = parse_composer_json(ws.root());
72 assert_eq!(mappings.len(), 2);
73
74 // Longest prefix first
75 assert_eq!(mappings[0].prefix, "Klarna\\Rest\\Tests\\");
76 assert_eq!(mappings[0].base_path, "tests/");
77 assert_eq!(mappings[1].prefix, "Klarna\\");
78 assert_eq!(mappings[1].base_path, "src/Klarna/");
79}
80
81#[test]
82fn test_parse_array_paths() {

Callers

nothing calls this directly

Calls 2

parse_composer_jsonFunction · 0.85
rootMethod · 0.80

Tested by

no test coverage detected