MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / resolve_auto_detect_vendor_bin

Function resolve_auto_detect_vendor_bin

src/phpstan.rs:875–892  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 2

resolve_phpstanFunction · 0.85
unwrapMethod · 0.45

Tested by

no test coverage detected