MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / instance_method_call

Function instance_method_call

tests/integration/inlay_hints.rs:357–386  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

355
356#[tokio::test]
357async fn instance_method_call() {
358 let backend = create_test_backend();
359 let uri = Url::parse("file:///test/inlay.php").unwrap();
360 let text = r#"<?php
361class Greeter {
362 public function greet(string $name, int $age): void {}
363}
364class Demo {
365 public function run(): void {
366 $g = new Greeter();
367 $g->greet('Alice', 25);
368 }
369}
370"#;
371
372 let hints = inlay_hints_for(&backend, &uri, text).await;
373 let line_hints = hints_at_line(&hints, 7);
374
375 let lbls = labels(&line_hints);
376 assert!(
377 lbls.contains(&"name:".to_string()),
378 "expected name: hint, got {:?}",
379 lbls
380 );
381 assert!(
382 lbls.contains(&"age:".to_string()),
383 "expected age: hint, got {:?}",
384 lbls
385 );
386}
387
388#[tokio::test]
389async fn static_method_call() {

Callers

nothing calls this directly

Calls 5

create_test_backendFunction · 0.85
inlay_hints_forFunction · 0.85
hints_at_lineFunction · 0.85
labelsFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected