| Age | Commit message (Collapse) | Author |
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
The structural methods are inherited from ArrayRepository in PHP, where
the lazy package load is driven by the overridden initialize(). Without
virtual dispatch, each repository now ensures that load via a &self
ensure_initialized() before delegating to the inner ArrayRepository.
This required moving the repositories' lazily-populated state behind
interior mutability (RefCell/Cell) and adding &self find_package_internal
/find_packages_internal helpers on ArrayRepository.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
JsonFormatter is intentionally unported in crates/shirabe/src/json, so
the ignored todo!() stub test serves no purpose. Remove the file and its
module declaration.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
Replace the todo!() markTestSkipped placeholders in set_up with a
compile-time cfg gate on the test function, mirroring PHP's setUp
skips on Windows and 32bit.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace hand-written mock/stub structs that re-implemented PHPUnit
mock-builder behavior (record-and-verify, manual call counters,
unreachable!() guards) with mockall::mock! locals across:
- package/loader: MockLoader, VersionGuesserMock
- command: ArchiveManager/RepositoryManager/EventDispatcher mocks
- util: ConfigSource/AuthJson mocks (auth_helper, bitbucket, github,
forgejo, gitlab)
- repository/vcs: github_driver NullConfigSource
- installer: CountingInstaller, RecordingBinaryInstaller, and the
DownloadManager mock (formerly common/downloader_stub.rs, now deleted)
- downloader: download_manager create_downloader_mock
Verification (counts/args) now lives in mockall expectations checked on
drop. installation_manager BinaryInstaller is left hand-written because
its as_binary_presence_interface seam returns Some(&mut self), which
mockall cannot express; io_stub and io_mock are left as-is.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Implement the four privateBitbucketWithOauthProvider cases that were
stubbed as an ignored todo!(). Extend IOStub with per-question
askAndHideAnswer responses and auth pre-seeding so the stateful OAuth
flow can be driven without willReturnCallback, and inject a mock
HttpDownloader plus no-op config sources to mirror PHPUnit's Config mock.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Implement the previously-ignored test, which dumps installed.php via
FilesystemRepository::write and byte-matches the Composer fixture. The
package link setters needed by configureLinks are now reachable through
the __set_provides/__set_replaces test hatches, so the PHP getPackage +
configureLinks shape can be reproduced faithfully.
Also switch both InstallationManager stubs in this file to a single
mockall mock, replacing the hand-rolled impls and call counter.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
PHP var_export breaks NUL bytes out of single-quoted string literals as
`' . "\0" . '` because a raw NUL byte is invalid in PHP source. The
shim embedded the raw byte instead, diverging from Composer's generated
installed.php (where references can contain NUL).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
setCatchErrors is an old-Symfony compatibility shim that exists in
neither Composer's PHP class nor Shirabe, and setAutoExit(false) is the
default in Shirabe, so neither is a reason a test is unportable. Drop
those mentions and point the application_test ignores at the real
blocker: do_run's script-command registration is still a todo!().
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Add __base_application accessor on ApplicationHandle so the test can
build an ApplicationDescription the way console commands do.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Process::fromShellCommandline and ZipArchive are now ported, so the git
pipeline + zip reading have faithful equivalents. Kept #[ignore]d: the finder
applies .gitattributes rules through BaseExcludeFilter::generate_pattern,
whose (?=$|/) look-ahead regexes the regex crate cannot compile (same blocker
as test_manual_excludes); also needs a git executable.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Ported faithfully via PackageHandle::new + __set_extra (now available on
PackageHandle). Kept #[ignore]d: date-based cases expose a shirabe_semver
normalize divergence (v20121020 -> 20121020.0.0.0), not a test-port issue.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
The FilesystemMock seam (already used by FileDownloaderTest) intercepts
removeDirectoryAsync before any rm -rf, so the prior execute_async blocker
no longer applies. getDownloaderMock gains the optional filesystem param.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
The IOMock and ConfigStubBuilder helpers now cover the writeError
verification and the get('disable-tls')=>true stub the PHP test needs.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
The IOMock helper is now available, so the verify_peer/verify_peer_name
SSL warning case can be exercised instead of left as todo!().
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Replace the todo!() stub with a faithful port of StatusCommandTest's
data-provided locally-modified-packages cases (source/dist), kept
#[ignore]d since install does not yet populate vendor/ offline.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
minify is intentionally unported, so only the expand half of
testMinifyExpand() is exercised.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
LibraryInstaller and PluginInstaller upgrade the Composer back-reference
in their constructors, so they could not be built inside Rc::new_cyclic
where the weak handle is not yet upgradeable. Defer create_default_
installers until after the cyclic Rc is established, where the weak
handle resolves, and implement it to register Library -> Plugin ->
Metapackage with a single shared BinaryInstaller.
To share one BinaryInstaller (as Composer does), LibraryInstaller's
binary_installer becomes Rc<RefCell<dyn BinaryInstallerInterface>>
instead of an owned Box; PluginInstaller and the __set_binary_installer
test seam follow.
This clears "Unknown installer type: metapackage". Un-ignores the six
remove tests that now pass; the remaining install/remove tests are
re-labeled for the next blocker (InstallationManager::execute_batch
still leaves the install/cleanup/repo.write promise chain as a todo!()
stub, so package operations do not actually execute).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the empty set_definition stub with the full InputArgument/
InputOption set from Composer's UpdateCommand. The symfony input
modeling was already complete; this was the last command still passing
an empty definition, which made it reject its own options.
Un-ignores test_no_security_blocking_allows_insecure_packages (now
passing) and re-labels the six remaining update tests with their actual
blockers (regex porting, resolver temporary-constraint, interactive
mode, bump-after-update solver pool) since the old "empty
InputDefinition" reason no longer applies.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
- StreamContextFactory: User-Agent reports the HTTP stack as "reqwest"
- RequestProxy::supports_secure_proxy: always true (reqwest+rustls can always
TLS to a proxy); drop the now-dead curl<7.52 guard in get_curl_options
- DiagnoseCommand::get_curl_version: phase-D TODO placeholder
Empirically verified: reqwest sends no default User-Agent (shirabe sets it
explicitly) and accepts https:// proxy URLs. init+install output stays
byte-identical to Composer.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Empty PhpMixed::Array now serializes as [], so the several places that build a
PHP `new \stdClass` via an empty Array were emitting [] where Composer writes
{}. Use PhpMixed::Object for those empty-object cases:
- InitCommand: require / require-dev
- Locker::fixupJsonDataType: stability-flags / platform / platform-dev
- JsonConfigSource fallback: require/config keys that must stay objects
Align the affected test expectations with Composer: JsonFile::read() decodes
with assoc=true, collapsing the on-disk {} back to [], so reads expect [].
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
PHP heredocs drop the newline before the closing marker, so a two-blank-line
fragment must port to "\n\n", not "\n\n\n", and the static initializer needs a
"\n" after the $initializer placeholder. This makes autoload_real.php and
autoload_static.php byte-identical to Composer's output. Rewrite the templates
as raw strings mirroring the PHP heredocs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
PHP arrays do not distinguish an empty map from an empty list, and
json_encode([]) always emits []. The Serialize impl emitted {} for an
empty associative array, which diverged from Composer when computing
the lock file content-hash for a composer.json with an empty require.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Several tests read process-global env vars and set/clear them via
TearDown but were not #[serial], so parallel execution could race.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Port 11 categories of previously-ignored Composer tests now reachable with
the mockall crate: DownloadManager, VCS/Perforce/File downloaders,
VersionSelector, PlatformRepository, Auditor, installer/FilesystemRepository,
RootPackageLoader, util auth/http, commands, and Cache.
Extract test seams additively on concrete structs as *Interface traits
(Runtime, HhvmDetector, VersionGuesser, RepositorySet, Perforce,
BinaryInstaller) plus mock-field seams (Cache, Filesystem); consumers take
trait objects. Mocks are defined locally in the test crates via
mockall::mock!, since automock-generated mocks are cfg(test)-gated and
invisible across the integration-test boundary.
dataProviders are ported in full; tests blocked by unported shims stay
#[ignore] with documented reasons rather than reduced or weakened.
Fix product bugs surfaced by the ports:
- util/github: use the exception code, not the HTTP status, for 401/403
- advisory: serialize empty audit maps as [] to match PHP json_encode
- repository/filesystem and downloader/file: fix RefCell double-borrow panics
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
Three porting mismatches caused show/info output to diverge from PHP:
- "not found" hint appended " in /composer.json" whenever the
working-dir key existed; PHP uses isset(), which is false for the
null default. Now only appended when the value is non-null.
- printPackages and generatePackageTree inserted "" for a missing
description instead of null, so isset() rendered a spurious trailing
space (and JSON emitted "" instead of null). Both now preserve null.
Un-ignores the eight rendering-gap tests these fix (plus one already
passing), and rewrites the remaining ignore reasons to name the real
blocker (package categorization, --no-dev filtering, RefCell borrow,
installer resolution) instead of a stale generic message.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
The jsonschema crate reports a missing required property against its
parent object, leaving the instance path empty at the root. This skipped
the "PROPERTY : MESSAGE" formatting that Composer produces. Append the
missing property name to the path so the output shape matches.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Composer/PartialComposer exposed its RepositoryManager, InstallationManager,
EventDispatcher, Locker, DownloadManager, AutoloadGenerator and ArchiveManager
as concrete types, but Composer's public setters (setDownloadManager() etc.)
let plugins swap in subclasses. Introduce a *Interface trait per manager and
store each as Rc<RefCell<dyn ...Interface>> so a replacement is honored.
Only Composer's slots and the sinks fed from its accessors become trait
objects; managers injected concretely at construction keep their concrete
references, matching PHP semantics. Fluent setters on the affected classes now
return () and Locker::update_hash is de-generified to a boxed FnOnce so the
traits stay object-safe.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
|
|
The ApplicationTester harness is in place, so port the four command
test bodies that were todo!() stubs and replace the stale "requires
ApplicationTester ... not implemented" ignore reasons with the actual
remaining Phase-C blockers. test_install_command_errors now passes;
the rest stay #[ignore] pending installer registration, the update
command InputDefinition, and the InstallationManager::execute port.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
file_put_contents_if_modified held a filesystem borrow_mut() receiver
while its argument re-borrowed the same RefCell via dump_to_php_code(),
panicking with "RefCell already borrowed". Build the file contents
before taking the borrow.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
getMissingRequirementInfo created an empty InstalledRepository (both
repos were left commented out as a stub), so every locked requirement
was reported as "not present in the lock file". Pass [lockedRepo,
rootRepo] to the constructor as the PHP does.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
The compiler confirms none of the call sites invoke a &mut self method
on the returned Composer, so the exclusive RefMut borrow was never
needed and only risked borrow check conflict. Switch every site to the
shared composer_full borrow and drop the now-dead composer_full_mut
helper.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Holding a RefMut<Composer> across execute() conflicted with the shared
borrow taken inside EventDispatcher::get_script_listeners, panicking with
"RefCell already mutably borrowed". All accessors used here take &self, so
a shared borrow suffices.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
The cli_tests suite runs the real CLI; under a TTY Composer's do_run logic
keeps interaction enabled, so `init` blocks on stdin. Holding the #[serial]
mutex while blocked made later tests (e.g. audit) appear to time out.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Matches the SymfonyStyle fix: ConsoleOutput is the sole ConsoleOutputInterface
implementor, so the instanceof check reduces to an AsAny downcast. get_error_output
now resolves correctly for non-console outputs instead of hitting todo!().
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
ShowCommand::configure registered an empty set_definition (placeholder), so every
show invocation failed with option/argument-does-not-exist. Port the full
argument/option list (package, version, --all/--locked/--installed/--platform/
--available/--self/--tree/--latest/--outdated/--format/... ) from PHP
ShowCommand::configure. Completion-suggestion closures and the format allowed-value
list are dropped to match the current InputArgument/InputOption API.
Un-ignores 14 ShowCommandTest cases; the remaining 28 keep faithful bodies but
stay ignored (show-rendering output gaps and remote-HTTP paths), reasons updated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
PRE_POOL_CREATE todo
RemoveCommand::execute held composer_full_mut across deactivate_installed_plugins
and event dispatch, both of which re-enter the same RefCell (composer.rs:500/446);
it only uses &self getters, so borrow it immutably.
PoolBuilder dispatched PluginEvents::PRE_POOL_CREATE by building an event that
required moving the (unclonable) repositories/Request — left as todo!(). The
event is purely plugin-facing and its result is never read in the no-plugin path
(Pool::new reads self.packages directly), so skip it with a TODO(plugin) note.
Removes the composer.rs re-entrancy and two todo!()s from the remove install
path; remove's tests now reach the unregistered-installers blocker (factory.rs).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
execute nested the already-built InstalledRepository inside a second
InstalledRepository, tripping the assertion that an InstalledRepository may not
contain another. PHP adds a PlatformRepository to the existing composite via
addRepository; do the same.
Un-ignores CheckPlatformReqsCommandTest::test_failed_platform_requirement.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
show/remove/global/audit/check-platform-reqs/status/self-update/validate tests
Faithfully port the remaining stubbed command test bodies from their PHP
counterparts (expected values verbatim). Newly passing: remove (6), global (2),
check-platform-reqs (1), status (1), audit (1), self-update (1).
Tests whose ported bodies reach a genuine unported src path keep faithful bodies
but stay #[ignore] with precise reasons. Dominant blockers surfaced:
- ShowCommand::configure stub (empty set_definition) blocks all 42 show tests
- Composer-handle RefCell re-entrancy in the Installer (composer.rs:500) and
Factory::create_composer (composer.rs:446) paths
- check_platform_reqs nests InstalledRepository in InstalledRepository
- audit's non-locked branch (audit_command.rs:285) and write_error3 re-entrancy
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|