()
| 312 | |
| 313 | #[test] |
| 314 | fn function_with_to_only() { |
| 315 | // Available up to 7.4 only |
| 316 | let backend = create_test_backend(); |
| 317 | |
| 318 | let stub_content = r#"<?php |
| 319 | use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; |
| 320 | |
| 321 | #[PhpStormStubsElementAvailable(to: '7.4')] |
| 322 | function 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 |
nothing calls this directly
no test coverage detected