()
| 235 | |
| 236 | #[test] |
| 237 | fn test_resolve_longest_prefix_wins() { |
| 238 | let ws = TestWorkspace::new( |
| 239 | r#"{ |
| 240 | "autoload": { |
| 241 | "psr-4": { |
| 242 | "Klarna\\": "src/Klarna/", |
| 243 | "Klarna\\Rest\\Tests\\": "tests/" |
| 244 | } |
| 245 | } |
| 246 | }"#, |
| 247 | ); |
| 248 | ws.create_php_file( |
| 249 | "tests/OrderTest.php", |
| 250 | "<?php\nnamespace Klarna\\Rest\\Tests;\nclass OrderTest {}\n", |
| 251 | ); |
| 252 | |
| 253 | let (mappings, _vendor_dir) = parse_composer_json(ws.root()); |
| 254 | let result = resolve_class_path(&mappings, ws.root(), "Klarna\\Rest\\Tests\\OrderTest"); |
| 255 | |
| 256 | assert!(result.is_some()); |
| 257 | let path = result.unwrap(); |
| 258 | assert!(path.ends_with("tests/OrderTest.php")); |
| 259 | } |
| 260 | |
| 261 | #[test] |
| 262 | fn test_resolve_builtin_types_return_none() { |
nothing calls this directly
no test coverage detected