aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/command/status_command_test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/tests/command/status_command_test.rs')
-rw-r--r--crates/shirabe/tests/command/status_command_test.rs41
1 files changed, 38 insertions, 3 deletions
diff --git a/crates/shirabe/tests/command/status_command_test.rs b/crates/shirabe/tests/command/status_command_test.rs
index 6154ea0..aa0ecc6 100644
--- a/crates/shirabe/tests/command/status_command_test.rs
+++ b/crates/shirabe/tests/command/status_command_test.rs
@@ -1,12 +1,47 @@
//! ref: composer/tests/Composer/Test/Command/StatusCommandTest.php
-#[ignore = "missing TestCase::init_temp_composer, create_composer_lock, create_installed_json, and get_application_tester (ApplicationTester) infrastructure"]
+use crate::test_case::{
+ RunOptions, create_composer_lock, create_installed_json, get_application_tester,
+ get_complete_package, init_temp_composer,
+};
+use serial_test::serial;
+use shirabe::package::handle::PackageInterfaceHandle;
+use shirabe_php_shim::PhpMixed;
+
#[test]
+#[serial]
fn test_no_local_changes() {
- todo!()
+ let tear_down = init_temp_composer(
+ Some(&serde_json::json!({ "require": { "root/req": "1.*" } })),
+ None,
+ None,
+ true,
+ );
+
+ let package = get_complete_package("root/req", "1.0.0");
+ package.__set_type("metapackage".to_string());
+
+ let packages: Vec<PackageInterfaceHandle> = vec![package.into()];
+
+ create_composer_lock(&packages, &[]);
+ create_installed_json(&packages, &[], true);
+
+ let mut app_tester = get_application_tester();
+ app_tester
+ .run(
+ vec![(PhpMixed::from("command"), PhpMixed::from("status"))],
+ RunOptions::default(),
+ )
+ .unwrap();
+
+ assert_eq!("No local changes", app_tester.get_display().trim());
+
+ drop(tear_down);
}
-#[ignore = "missing TestCase::init_temp_composer and get_application_tester (ApplicationTester) infrastructure"]
+#[ignore = "exercises `install` over the network (downloads composer/class-map-generator from a git \
+ source or smarty/smarty from a dist zip), then mutates the installed package and runs \
+ `status`; the install path needs real network access"]
#[test]
fn test_locally_modified_packages() {
todo!()