()
| 4414 | |
| 4415 | #[test] |
| 4416 | fn detects_method_context() { |
| 4417 | let content = |
| 4418 | "<?php\nclass Foo {\n public function bar() {\n $x = 1;\n }\n}\n"; |
| 4419 | let offset = content.find("$x").unwrap() as u32; |
| 4420 | let ctx = find_enclosing_context(content, offset, false); |
| 4421 | assert!(ctx.is_some()); |
| 4422 | let ctx = ctx.unwrap(); |
| 4423 | assert_eq!(ctx.target, ExtractionTarget::Method); |
| 4424 | } |
| 4425 | |
| 4426 | #[test] |
| 4427 | fn detects_method_context_with_this() { |
nothing calls this directly
no test coverage detected