()
| 129 | |
| 130 | #[test] |
| 131 | fn test_resolve_simple_class() { |
| 132 | let ws = TestWorkspace::new( |
| 133 | r#"{ |
| 134 | "autoload": { |
| 135 | "psr-4": { |
| 136 | "Klarna\\": "src/Klarna/" |
| 137 | } |
| 138 | } |
| 139 | }"#, |
| 140 | ); |
| 141 | ws.create_php_file( |
| 142 | "src/Klarna/Customer.php", |
| 143 | "<?php\nnamespace Klarna;\nclass Customer {}\n", |
| 144 | ); |
| 145 | |
| 146 | let (mappings, _vendor_dir) = parse_composer_json(ws.root()); |
| 147 | let result = resolve_class_path(&mappings, ws.root(), "Klarna\\Customer"); |
| 148 | |
| 149 | assert!(result.is_some()); |
| 150 | let path = result.unwrap(); |
| 151 | assert!(path.ends_with("src/Klarna/Customer.php")); |
| 152 | } |
| 153 | |
| 154 | #[test] |
| 155 | fn test_resolve_nested_namespace() { |
nothing calls this directly
no test coverage detected