()
| 741 | |
| 742 | #[test] |
| 743 | fn parse_message_without_identifier() { |
| 744 | let json = r#"{ |
| 745 | "totals": {"errors": 0, "file_errors": 1}, |
| 746 | "files": { |
| 747 | "/project/src/Foo.php": { |
| 748 | "errors": 1, |
| 749 | "messages": [ |
| 750 | { |
| 751 | "message": "Some old-style error.", |
| 752 | "line": 1, |
| 753 | "ignorable": true |
| 754 | } |
| 755 | ] |
| 756 | } |
| 757 | }, |
| 758 | "errors": [] |
| 759 | }"#; |
| 760 | let path = Path::new("/project/src/Foo.php"); |
| 761 | let diags = parse_phpstan_json(json, path).unwrap(); |
| 762 | assert_eq!(diags.len(), 1); |
| 763 | assert_eq!( |
| 764 | diags[0].code, |
| 765 | Some(NumberOrString::String("phpstan".to_string())) |
| 766 | ); |
| 767 | } |
| 768 | |
| 769 | #[test] |
| 770 | fn parse_relative_path_match() { |
nothing calls this directly
no test coverage detected