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

Function cross_file_parent_class

tests/integration/code_lens.rs:392–435  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

390
391#[test]
392fn cross_file_parent_class() {
393 let (backend, _dir) = create_psr4_workspace(
394 r#"{ "autoload": { "psr-4": { "App\\": "src/" } } }"#,
395 &[
396 (
397 "src/Base.php",
398 r#"<?php
399namespace App;
400
401class Base {
402 public function handle(): void {}
403}
404"#,
405 ),
406 (
407 "src/Handler.php",
408 r#"<?php
409namespace App;
410
411class Handler extends Base {
412 public function handle(): void {}
413}
414"#,
415 ),
416 ],
417 );
418
419 let base_uri = format!("file://{}", _dir.path().join("src/Base.php").display());
420 let handler_uri = format!("file://{}", _dir.path().join("src/Handler.php").display());
421
422 let base_content = std::fs::read_to_string(_dir.path().join("src/Base.php")).unwrap();
423 let handler_content = std::fs::read_to_string(_dir.path().join("src/Handler.php")).unwrap();
424
425 backend.update_ast(&base_uri, &base_content);
426 backend.update_ast(&handler_uri, &handler_content);
427
428 let lenses = backend
429 .handle_code_lens(&handler_uri, &handler_content)
430 .unwrap_or_default();
431 let titles = lens_titles(&lenses);
432
433 assert_eq!(titles.len(), 1);
434 assert_eq!(titles[0], "↑ Base::handle");
435}
436
437// ─── Abstract Method Implementation ────────────────────────────────────────
438

Callers

nothing calls this directly

Calls 5

create_psr4_workspaceFunction · 0.85
lens_titlesFunction · 0.85
update_astMethod · 0.80
handle_code_lensMethod · 0.80
unwrapMethod · 0.45

Tested by

no test coverage detected