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

Function test_completion_author_blade

tests/integration/blade_debug.rs:277–299  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

275
276 #[tokio::test]
277 async fn test_completion_author_blade() {
278 let backend = create_test_backend();
279 open_scaffolding(&backend).await;
280 let uri_str = "file:///resources/views/comp.blade.php";
281 let text = "@php\n/**\n * @var \\App\\Models\\BlogAuthor $author\n */\n@endphp\n\n<p>{{ $author-> }}</p>";
282 backend
283 .did_open(DidOpenTextDocumentParams {
284 text_document: TextDocumentItem {
285 uri: Url::parse(uri_str).unwrap(),
286 language_id: "blade".to_string(),
287 version: 1,
288 text: text.to_string(),
289 },
290 })
291 .await;
292 // "<p>{{ $author-> }}</p>" — line 6, col 15
293 let labels = completion_labels(&backend, uri_str, 6, 15).await;
294 assert!(
295 labels.iter().any(|l| l == "name"),
296 "Blade: $author-> should offer 'name', got: {:?}",
297 labels
298 );
299 }
300
301 // ── GTD on ->name resolves to BlogAuthor::$name ─────────────────────
302

Callers

nothing calls this directly

Calls 5

create_test_backendFunction · 0.85
open_scaffoldingFunction · 0.85
completion_labelsFunction · 0.85
did_openMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected