()
| 873 | |
| 874 | #[test] |
| 875 | fn resolve_auto_detect_vendor_bin() { |
| 876 | let dir = tempfile::tempdir().unwrap(); |
| 877 | let bin_path = dir.path().join("vendor").join("bin"); |
| 878 | std::fs::create_dir_all(&bin_path).unwrap(); |
| 879 | let phpstan = bin_path.join("phpstan"); |
| 880 | std::fs::write(&phpstan, "#!/bin/sh\n").unwrap(); |
| 881 | |
| 882 | #[cfg(unix)] |
| 883 | { |
| 884 | use std::os::unix::fs::PermissionsExt; |
| 885 | std::fs::set_permissions(&phpstan, std::fs::Permissions::from_mode(0o755)).unwrap(); |
| 886 | } |
| 887 | |
| 888 | let config = PhpStanConfig::default(); |
| 889 | let result = resolve_phpstan(Some(dir.path()), &config, None); |
| 890 | assert!(result.is_some()); |
| 891 | assert_eq!(result.unwrap().path, phpstan); |
| 892 | } |
| 893 | |
| 894 | #[test] |
| 895 | fn resolve_auto_detect_custom_bin_dir() { |
nothing calls this directly
no test coverage detected