()
| 305 | |
| 306 | #[tokio::test] |
| 307 | async fn test_parse_php_static_method() { |
| 308 | let backend = create_test_backend(); |
| 309 | let php = concat!( |
| 310 | "<?php\n", |
| 311 | "class Factory {\n", |
| 312 | " public static function create(string $type): self {}\n", |
| 313 | " public function build(): void {}\n", |
| 314 | "}\n", |
| 315 | ); |
| 316 | |
| 317 | let classes = backend.parse_php(php); |
| 318 | assert_eq!(classes.len(), 1); |
| 319 | assert_eq!(classes[0].methods.len(), 2); |
| 320 | |
| 321 | let create = &classes[0].methods[0]; |
| 322 | assert_eq!(create.name, "create"); |
| 323 | assert!(create.is_static, "create should be static"); |
| 324 | assert_eq!(create.parameters.len(), 1); |
| 325 | assert_eq!(create.parameters[0].name, "$type"); |
| 326 | |
| 327 | let build = &classes[0].methods[1]; |
| 328 | assert_eq!(build.name, "build"); |
| 329 | assert!(!build.is_static, "build should not be static"); |
| 330 | } |
| 331 | |
| 332 | #[tokio::test] |
| 333 | async fn test_parse_php_extracts_constants() { |
nothing calls this directly
no test coverage detected