()
| 4404 | |
| 4405 | #[test] |
| 4406 | fn detects_function_context() { |
| 4407 | let content = "<?php\nfunction foo() {\n $x = 1;\n}\n"; |
| 4408 | let offset = content.find("$x").unwrap() as u32; |
| 4409 | let ctx = find_enclosing_context(content, offset, false); |
| 4410 | assert!(ctx.is_some()); |
| 4411 | let ctx = ctx.unwrap(); |
| 4412 | assert_eq!(ctx.target, ExtractionTarget::Function); |
| 4413 | } |
| 4414 | |
| 4415 | #[test] |
| 4416 | fn detects_method_context() { |
nothing calls this directly
no test coverage detected