()
| 1908 | |
| 1909 | #[test] |
| 1910 | fn aligns_param_columns() { |
| 1911 | let php = r#"<?php |
| 1912 | class Foo { |
| 1913 | /** |
| 1914 | * @param string $a |
| 1915 | */ |
| 1916 | public function bar(string $a, int $b, array $items): void {} |
| 1917 | } |
| 1918 | "#; |
| 1919 | let pos = php.find("@param string").unwrap() as u32; |
| 1920 | let info = find_info(php, pos).unwrap(); |
| 1921 | let cl = no_class_loader(); |
| 1922 | let updated = build_updated_docblock( |
| 1923 | &info, |
| 1924 | php, |
| 1925 | &[], |
| 1926 | &cl, |
| 1927 | no_function_loader(), |
| 1928 | &HashMap::new(), |
| 1929 | &None, |
| 1930 | ); |
| 1931 | // All $names should be aligned at the same column. |
| 1932 | assert!( |
| 1933 | updated.contains("@param string $a"), |
| 1934 | "Should have string padded: {}", |
| 1935 | updated |
| 1936 | ); |
| 1937 | assert!( |
| 1938 | updated.contains("@param int $b"), |
| 1939 | "Should have int padded: {}", |
| 1940 | updated |
| 1941 | ); |
| 1942 | assert!( |
| 1943 | updated.contains("@param array<mixed> $items"), |
| 1944 | "Should have array<mixed> padded: {}", |
| 1945 | updated |
| 1946 | ); |
| 1947 | } |
| 1948 | |
| 1949 | #[test] |
| 1950 | fn no_spurious_blank_line_after_open() { |
nothing calls this directly
no test coverage detected