aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/command/archive_command_test.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-11 16:33:05 +0900
committernsfisis <nsfisis@gmail.com>2026-07-11 16:33:05 +0900
commit27d00055df8691a6bd99aaf38633a7338b16cc6a (patch)
tree4af17ccff5f8c2d09156fa62c559e60e3e683dac /crates/shirabe/tests/command/archive_command_test.rs
parent1ec2220def43e37e5a65b96dde93c19b493258f4 (diff)
downloadphp-shirabe-27d00055df8691a6bd99aaf38633a7338b16cc6a.tar.gz
php-shirabe-27d00055df8691a6bd99aaf38633a7338b16cc6a.tar.zst
php-shirabe-27d00055df8691a6bd99aaf38633a7338b16cc6a.zip
chore: use fully-qualified name for Rc/RefCell
Diffstat (limited to 'crates/shirabe/tests/command/archive_command_test.rs')
-rw-r--r--crates/shirabe/tests/command/archive_command_test.rs66
1 files changed, 39 insertions, 27 deletions
diff --git a/crates/shirabe/tests/command/archive_command_test.rs b/crates/shirabe/tests/command/archive_command_test.rs
index 991f615a..322894db 100644
--- a/crates/shirabe/tests/command/archive_command_test.rs
+++ b/crates/shirabe/tests/command/archive_command_test.rs
@@ -22,8 +22,6 @@ use shirabe_external_packages::symfony::console::output::OutputInterface;
use shirabe_external_packages::symfony::console::output::buffered_output::BufferedOutput;
use shirabe_php_shim::PhpMixed;
use shirabe_semver::VersionParser;
-use std::cell::RefCell;
-use std::rc::Rc;
// PHP mocks `Composer\Package\Archiver\ArchiveManager` with
// getMockBuilder(...)->disableOriginalConstructor().
@@ -108,17 +106,21 @@ fn root_package(name: &str, version: &str) -> RootPackageHandle {
}
fn full_composer(composer: Composer) -> PartialComposerHandle {
- PartialComposerHandle::from_rc(Rc::new(RefCell::new(PartialOrFullComposer::Full(composer))))
+ PartialComposerHandle::from_rc(std::rc::Rc::new(std::cell::RefCell::new(
+ PartialOrFullComposer::Full(composer),
+ )))
}
#[test]
fn test_uses_config_from_composer_object() {
- let input: Rc<RefCell<dyn InputInterface>> =
- Rc::new(RefCell::new(ArrayInput::new(vec![], None).unwrap()));
- let output: Rc<RefCell<dyn OutputInterface>> =
- Rc::new(RefCell::new(BufferedOutput::new(None, false, None)));
+ let input: std::rc::Rc<std::cell::RefCell<dyn InputInterface>> = std::rc::Rc::new(
+ std::cell::RefCell::new(ArrayInput::new(vec![], None).unwrap()),
+ );
+ let output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>> = std::rc::Rc::new(
+ std::cell::RefCell::new(BufferedOutput::new(None, false, None)),
+ );
- let config: Rc<RefCell<Config>> = ConfigStubBuilder::new()
+ let config: std::rc::Rc<std::cell::RefCell<Config>> = ConfigStubBuilder::new()
.with("archive-format", PhpMixed::from("zip"))
.build_shared();
@@ -144,8 +146,10 @@ fn test_uses_config_from_composer_object() {
let mut composer = Composer::new();
composer.set_config(config);
- composer.set_archive_manager(Rc::new(RefCell::new(manager)));
- composer.set_event_dispatcher(Rc::new(RefCell::new(noop_event_dispatcher())));
+ composer.set_archive_manager(std::rc::Rc::new(std::cell::RefCell::new(manager)));
+ composer.set_event_dispatcher(std::rc::Rc::new(std::cell::RefCell::new(
+ noop_event_dispatcher(),
+ )));
composer.set_package(package.into());
let composer = full_composer(composer);
@@ -158,10 +162,12 @@ fn test_uses_config_from_composer_object() {
#[test]
fn test_uses_config_from_factory_when_composer_is_not_defined() {
- let input: Rc<RefCell<dyn InputInterface>> =
- Rc::new(RefCell::new(ArrayInput::new(vec![], None).unwrap()));
- let output: Rc<RefCell<dyn OutputInterface>> =
- Rc::new(RefCell::new(BufferedOutput::new(None, false, None)));
+ let input: std::rc::Rc<std::cell::RefCell<dyn InputInterface>> = std::rc::Rc::new(
+ std::cell::RefCell::new(ArrayInput::new(vec![], None).unwrap()),
+ );
+ let output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>> = std::rc::Rc::new(
+ std::cell::RefCell::new(BufferedOutput::new(None, false, None)),
+ );
// tryComposer() returns null (no Composer set), so execute() builds the Config via the Factory
// and `archive` is stubbed (PHPUnit overrides initialize/tryComposer/archive).
@@ -188,17 +194,19 @@ fn test_uses_config_from_factory_when_composer_is_not_defined() {
#[test]
fn test_uses_config_from_composer_object_with_package_name() {
- let input: Rc<RefCell<dyn InputInterface>> = Rc::new(RefCell::new(
- ArrayInput::new(
- vec![(PhpMixed::from("package"), PhpMixed::from("foo/bar"))],
- None,
- )
- .unwrap(),
- ));
- let output: Rc<RefCell<dyn OutputInterface>> =
- Rc::new(RefCell::new(BufferedOutput::new(None, false, None)));
+ let input: std::rc::Rc<std::cell::RefCell<dyn InputInterface>> =
+ std::rc::Rc::new(std::cell::RefCell::new(
+ ArrayInput::new(
+ vec![(PhpMixed::from("package"), PhpMixed::from("foo/bar"))],
+ None,
+ )
+ .unwrap(),
+ ));
+ let output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>> = std::rc::Rc::new(
+ std::cell::RefCell::new(BufferedOutput::new(None, false, None)),
+ );
- let config: Rc<RefCell<Config>> = ConfigStubBuilder::new()
+ let config: std::rc::Rc<std::cell::RefCell<Config>> = ConfigStubBuilder::new()
.with("archive-format", PhpMixed::from("zip"))
.build_shared();
@@ -241,10 +249,14 @@ fn test_uses_config_from_composer_object_with_package_name() {
let mut composer = Composer::new();
composer.set_config(config);
- composer.set_archive_manager(Rc::new(RefCell::new(manager)));
- composer.set_event_dispatcher(Rc::new(RefCell::new(noop_event_dispatcher())));
+ composer.set_archive_manager(std::rc::Rc::new(std::cell::RefCell::new(manager)));
+ composer.set_event_dispatcher(std::rc::Rc::new(std::cell::RefCell::new(
+ noop_event_dispatcher(),
+ )));
composer.set_package(package.into());
- composer.set_repository_manager(Rc::new(RefCell::new(repository_manager)));
+ composer.set_repository_manager(std::rc::Rc::new(std::cell::RefCell::new(
+ repository_manager,
+ )));
let composer = full_composer(composer);
let command = ArchiveCommand::new();