aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/tests/cli_config.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-21 20:54:29 +0900
committernsfisis <nsfisis@gmail.com>2026-02-21 20:54:29 +0900
commite40ae3649d62a933211e81d8ac773fdd86ff1dfb (patch)
tree22713882537531c2b0f0a55248045d9f280ce3fe /crates/mozart/tests/cli_config.rs
parent3c8ce2b72daccccc88278b8dfbff1a1acc39096c (diff)
downloadphp-mozart-e40ae3649d62a933211e81d8ac773fdd86ff1dfb.tar.gz
php-mozart-e40ae3649d62a933211e81d8ac773fdd86ff1dfb.tar.zst
php-mozart-e40ae3649d62a933211e81d8ac773fdd86ff1dfb.zip
test(cli): add end-to-end integration tests for CLI commands
Add 23 integration tests using assert_cmd and predicates covering about, validate, show, licenses, install, config, init, and dump-autoload commands with shared test helpers and fixture projects. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/tests/cli_config.rs')
-rw-r--r--crates/mozart/tests/cli_config.rs40
1 files changed, 40 insertions, 0 deletions
diff --git a/crates/mozart/tests/cli_config.rs b/crates/mozart/tests/cli_config.rs
new file mode 100644
index 0000000..e433653
--- /dev/null
+++ b/crates/mozart/tests/cli_config.rs
@@ -0,0 +1,40 @@
+mod common;
+
+use predicates::str::contains;
+
+#[test]
+fn test_config_list() {
+ let project = common::copy_fixture_to_temp("minimal");
+ common::mozart_cmd()
+ .arg("config")
+ .arg("--list")
+ .arg("--working-dir")
+ .arg(project.path())
+ .assert()
+ .success()
+ .stdout(contains("vendor-dir"));
+}
+
+#[test]
+fn test_config_single_key() {
+ let project = common::copy_fixture_to_temp("minimal");
+ common::mozart_cmd()
+ .arg("config")
+ .arg("vendor-dir")
+ .arg("--working-dir")
+ .arg(project.path())
+ .assert()
+ .success()
+ .stdout(contains("vendor"));
+}
+
+#[test]
+fn test_config_no_key_fails() {
+ let project = common::copy_fixture_to_temp("minimal");
+ common::mozart_cmd()
+ .arg("config")
+ .arg("--working-dir")
+ .arg(project.path())
+ .assert()
+ .failure();
+}