()
| 642 | |
| 643 | #[test] |
| 644 | fn parse_non_ignorable_diagnostic() { |
| 645 | let json = r#"{ |
| 646 | "totals": {"errors": 0, "file_errors": 1}, |
| 647 | "files": { |
| 648 | "/project/src/Foo.php": { |
| 649 | "errors": 1, |
| 650 | "messages": [ |
| 651 | { |
| 652 | "message": "Private method Foo::bar() overriding public method Parent::bar() should also be public.", |
| 653 | "line": 10, |
| 654 | "ignorable": false, |
| 655 | "identifier": "method.visibility" |
| 656 | } |
| 657 | ] |
| 658 | } |
| 659 | }, |
| 660 | "errors": [] |
| 661 | }"#; |
| 662 | let path = Path::new("/project/src/Foo.php"); |
| 663 | let diags = parse_phpstan_json(json, path).unwrap(); |
| 664 | assert_eq!(diags.len(), 1); |
| 665 | assert_eq!( |
| 666 | diags[0].data, |
| 667 | Some(serde_json::json!({ "ignorable": false })) |
| 668 | ); |
| 669 | } |
| 670 | |
| 671 | #[test] |
| 672 | fn parse_ignorable_defaults_true_when_field_absent() { |
nothing calls this directly
no test coverage detected