diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-12 07:01:55 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-15 09:27:59 +0900 |
| commit | 592ab8b1a2d73a1f77db8a7b7e17238ce3577030 (patch) | |
| tree | ccd0e3d550c9591557a84112f110bea355cb7444 /crates/shirabe/tests/application_test.rs | |
| parent | bb4684f7d1c51bc1be9c1bda1b00cb52c839cd25 (diff) | |
| download | php-shirabe-592ab8b1a2d73a1f77db8a7b7e17238ce3577030.tar.gz php-shirabe-592ab8b1a2d73a1f77db8a7b7e17238ce3577030.tar.zst php-shirabe-592ab8b1a2d73a1f77db8a7b7e17238ce3577030.zip | |
feat(cli): report Shirabe's own identity instead of Composer's
The binary called itself Composer everywhere: the application name, the
logo, --version, about, and every warning that talks about the running
program. Prompts to file a bug also pointed at Composer's issue tracker.
Add SHIRABE_VERSION and SHIRABE_RELEASE_DATE next to the Composer version
constants and report those, naming the Composer version this port tracks
alongside them. Composer::VERSION and getVersion() are untouched, so the
composer platform package, composer-runtime-api and the HTTP User-Agent
keep the value plugins and package repositories expect.
build.rs stamps the release date with the UTC date of the HEAD commit,
the way Composer's Compiler fills in @release_date@ when building the
phar. It now also fails the build when git cannot be read, instead of
letting COMPOSER_DEV_WARNING_TIME fall back to the tagged-release value
and suppress the outdated-build warning forever.
Messages about the Composer ecosystem keep their wording. Two of them are
pinned by upstream installer fixtures (Rule's "cannot be modified by
Composer" and SolverProblemsException's "you can run Composer with") and
stay as they are so those fixtures can keep being used verbatim.
The e2e list comparison against upstream Composer now skips the banner,
which cannot match by design, and compares everything below it as before.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/application_test.rs')
| -rw-r--r-- | crates/shirabe/tests/application_test.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/shirabe/tests/application_test.rs b/crates/shirabe/tests/application_test.rs index 1c93b790..23bc909a 100644 --- a/crates/shirabe/tests/application_test.rs +++ b/crates/shirabe/tests/application_test.rs @@ -40,7 +40,7 @@ fn test_dev_warning() { let _tear_down = TearDown; set_up(); - let application = ApplicationHandle::new("Composer".to_string(), "".to_string()).unwrap(); + let application = ApplicationHandle::new("Shirabe".to_string(), "".to_string()).unwrap(); application.__set_dev_warning_time(Some(time() - 1)); @@ -59,7 +59,7 @@ fn test_dev_warning() { application.do_run(input, output_trait).unwrap(); let expected_output = format!( - "<warning>Warning: This development build of Composer is over 60 days old. It is recommended to update it by running \"{} self-update\" to get the latest version.</warning>{}", + "<warning>Warning: This development build of Shirabe is over 60 days old. It is recommended to update it by running \"{} self-update\" to get the latest version.</warning>{}", PHP_SERVER .lock() .unwrap() @@ -82,7 +82,7 @@ fn test_dev_warning_suppressed_for_self_update() { return; } - let application = ApplicationHandle::new("Composer".to_string(), "".to_string()).unwrap(); + let application = ApplicationHandle::new("Shirabe".to_string(), "".to_string()).unwrap(); let command: std::rc::Rc<std::cell::RefCell<dyn Command>> = std::rc::Rc::new(std::cell::RefCell::new(SelfUpdateCommand::new())); application.add(command).unwrap(); @@ -113,7 +113,7 @@ fn test_process_isolation_works_multiple_times() { let _tear_down = TearDown; set_up(); - let application = ApplicationHandle::new("Composer".to_string(), "".to_string()).unwrap(); + let application = ApplicationHandle::new("Shirabe".to_string(), "".to_string()).unwrap(); let command: std::rc::Rc<std::cell::RefCell<dyn Command>> = std::rc::Rc::new(std::cell::RefCell::new(AboutCommand::new())); application.add(command).unwrap(); @@ -166,7 +166,7 @@ fn test_no_plugins_disables_plugins_when_script_commands_exist() { true, ); - let application = ApplicationHandle::new("Composer".to_string(), "".to_string()).unwrap(); + let application = ApplicationHandle::new("Shirabe".to_string(), "".to_string()).unwrap(); application.set_catch_exceptions(false); // Run list command with --no-plugins, this triggers script command registration which previously @@ -231,7 +231,7 @@ fn test_script_command_takes_priority_over_abbreviated_builtin_command() { true, ); - let application = ApplicationHandle::new("Composer".to_string(), "".to_string()).unwrap(); + let application = ApplicationHandle::new("Shirabe".to_string(), "".to_string()).unwrap(); application.set_catch_exceptions(false); let app_output = std::rc::Rc::new(std::cell::RefCell::new(BufferedOutput::new( |
