()
| 53 | |
| 54 | #[test] |
| 55 | fn 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] |
| 82 | fn test_parse_array_paths() { |
nothing calls this directly
no test coverage detected