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

Function function_with_to_only

tests/integration/php_version.rs:314–330  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

312
313#[test]
314fn function_with_to_only() {
315 // Available up to 7.4 only
316 let backend = create_test_backend();
317
318 let stub_content = r#"<?php
319use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable;
320
321#[PhpStormStubsElementAvailable(to: '7.4')]
322function legacy_only(): void {}
323"#;
324
325 let functions = backend.parse_functions_versioned(stub_content, Some(PhpVersion::new(8, 0)));
326 assert_eq!(functions.len(), 0, "should be excluded for PHP 8.0");
327
328 let functions = backend.parse_functions_versioned(stub_content, Some(PhpVersion::new(7, 4)));
329 assert_eq!(functions.len(), 1, "should be included for PHP 7.4");
330}
331
332// ─── Parameter-level version filtering ──────────────────────────────────────
333

Callers

nothing calls this directly

Calls 2

create_test_backendFunction · 0.85

Tested by

no test coverage detected