diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-25 17:49:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-26 00:20:05 +0900 |
| commit | d4ec1dcb6fc04ff029ded35cc2fcc14f3bbc02ad (patch) | |
| tree | 0a85bd085961fcdfd5570cafc3b44ba5eb8cb152 /crates/shirabe/tests/command/status_command_test.rs | |
| parent | 22d0b327368e5f39de6f381046c081d08efdba15 (diff) | |
| download | php-shirabe-d4ec1dcb6fc04ff029ded35cc2fcc14f3bbc02ad.tar.gz php-shirabe-d4ec1dcb6fc04ff029ded35cc2fcc14f3bbc02ad.tar.zst php-shirabe-d4ec1dcb6fc04ff029ded35cc2fcc14f3bbc02ad.zip | |
test: port 32 command/repository/downloader tests
Add create_installed_json/create_composer_lock test helpers. Port command (8),
repository path/forgejo/perforce/vcs (11), and fossil/hg/download_manager (13)
tests. Fix production porting bugs: root_package_loader/forgejo_url/version_bumper
regex delimiters, repository_manager create_repository_by_class, array_loader
isset, licenses_command RefCell borrow; implement disk_free_space and
touch2/touch3 via libc.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/command/status_command_test.rs')
| -rw-r--r-- | crates/shirabe/tests/command/status_command_test.rs | 41 |
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!() |
