()
| 2022 | |
| 2023 | #[test] |
| 2024 | fn adds_missing_throws() { |
| 2025 | let php = r#"<?php |
| 2026 | class Foo { |
| 2027 | /** |
| 2028 | * @param string $a |
| 2029 | * |
| 2030 | * @return string |
| 2031 | */ |
| 2032 | public function bar(string $a): string { |
| 2033 | throw new \RuntimeException('oops'); |
| 2034 | } |
| 2035 | } |
| 2036 | "#; |
| 2037 | let pos = php.find("@param string").unwrap() as u32; |
| 2038 | let info = find_info(php, pos).unwrap(); |
| 2039 | let cl = no_class_loader(); |
| 2040 | let updated = build_updated_docblock( |
| 2041 | &info, |
| 2042 | php, |
| 2043 | &[], |
| 2044 | &cl, |
| 2045 | no_function_loader(), |
| 2046 | &HashMap::new(), |
| 2047 | &None, |
| 2048 | ); |
| 2049 | assert!( |
| 2050 | updated.contains("@throws RuntimeException"), |
| 2051 | "Should add missing @throws: {}", |
| 2052 | updated |
| 2053 | ); |
| 2054 | } |
| 2055 | |
| 2056 | #[test] |
| 2057 | fn does_not_duplicate_existing_throws() { |
nothing calls this directly
no test coverage detected