aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/util/main.rs
AgeCommit message (Collapse)Author
2026-06-26test: port 35 auth/installer/io/zip/bitbucket tests; implement date_creatensfisis
Port auth_helper (14), library_installer (8), console_io (7), zip_downloader (3), git_bitbucket_driver (3) tests. Implement date_create/strtotime for the ISO8601/ RFC3339/relative formats Composer uses (unknown input -> None, no silent guess). Fix production bugs: Question::is_assoc list-vs-assoc, auth_helper gitlab-domains list handling, LibraryInstaller RefCell double-borrow, ZipArchive::extract_to ErrorException propagation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26feat(test): add HttpDownloaderMock, IOStub, and Config stub helpersnsfisis
IOStub and ConfigStubBuilder provide getMockBuilder-style configurable stubs. Wired into util/repository/downloader/command test targets. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26feat(util): add ProcessExecutorMock test infra; port SymfonyStyle message ↵nsfisis
methods Add an internal mock hook to ProcessExecutor (None in production) so tests can stub command execution without spawning processes, mirroring Composer's ProcessExecutorMock subclass. Add get_process_executor_mock helper and two verification tests. Implement SymfonyStyle's message-handling methods. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: port remaining repository and util tests as stubsnsfisis
All ignored: Composer/Filesystem/Platform/Vcs repositories and the AuthHelper/Bitbucket/Git/Perforce/RemoteFilesystem/Svn utils mock IO/Config/HttpDownloader(curl)/ProcessExecutor or use reflection; Filesystem/ProcessExecutor/StreamContextFactory/ProxyManager need on-disk fixtures or proxy env. setUp/tearDown not ported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: port GitHub/GitLab/Forgejo, Search/CheckPlatformReqs, ZipArchiver stubsnsfisis
All ignored/todo!(): the auth-util tests mock IO/Config/HttpDownloader, the command tests need ApplicationTester, and ZipArchiver builds a zip via ZipArchive (todo!()). setUp/tearDown not ported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: port IniHelperTest and RepositoryUtilsTestnsfisis
IniHelper cases reach XdebugHandler::get_all_ini_files (todo!()); RepositoryUtils filterRequiredPackages is fully modeled but building linked packages via ArrayLoader parses constraints with a look-around regex the regex crate cannot compile. Both ignored. setUp/tearDown not ported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: port ClassLoader/HttpDownloader/Reinstall command testsnsfisis
ClassLoader::getPrefixes verified; loadClass/serializability rely on PHP runtime class loading and serialize() (stubbed). HttpDownloader and Reinstall need curl/ApplicationTester (stubbed). Wires up the autoload test target. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: port TlsHelperTest and HhvmDetectorTest as stubsnsfisis
TlsHelper is not ported; the HhvmDetector cases are always skipped (no HHVM, no hhvm executable). All ignored/todo!(). setUp not ported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: port Documentation/Xz/Audit/ErrorHandler/PharArchiver tests as stubsnsfisis
All ignored/todo!(): they need infrastructure not yet ported (console Application, HttpDownloader/curl, ApplicationTester, PHP runtime error handler, PharData/ZipArchive). Wires up the downloader test target. setUp/tearDown not ported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port MetadataMinifierTestnsfisis
Stubbed as todo!()/ignored: MetadataMinifier::minify is not ported upstream. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port PackageSorterTestnsfisis
PackageSorter::sort_packages reaches strnatcasecmp (a todo!() in the php-shim) whenever it compares equally-weighted packages, so the cases are #[ignore]. createPackage is reconstructed via ArrayLoader because the public handle API only exposes link setters on root packages. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port ZipTestnsfisis
Zip::get_composer_json relies on ZipArchive, whose constructor is a todo!() in the php-shim, so all cases are #[ignore] while compiling. Reuses the existing PHP Fixtures/Zip archives. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port NoProxyPatternTestnsfisis
NoProxyPattern::test reaches a todo!() (substr_count) in the php-shim, so all cases are marked #[ignore] while the test code compiles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port ConfigValidatorTestnsfisis
Reuses the existing PHP Fixtures composer_*.json. All four cases are marked #[ignore] because ConfigValidator::validate reaches a todo!() in the php-shim. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port UrlTestnsfisis
Both testUpdateDistReference and testSanitize are marked #[ignore] because the underlying regex patterns cannot be compiled by the regex crate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port ProxyItemTestnsfisis
Both testThrowsOnMalformedUrl and testUrlFormatting are marked #[ignore] because ProxyItem::new reaches a todo!() in the php-shim. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port TarTestnsfisis
All cases reuse the existing PHP fixtures under composer/tests/Composer/Test/Util/Fixtures/Tar. Marked #[ignore] because PharData::new is todo!() in the php-shim. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: port ForgejoUrl, Silencer, PlatformRequirementFilterFactory testsnsfisis
Factory's instance-creation tests pass. ForgejoUrl (undelimited regex panic), Silencer (trigger_error/microtime todo!()), and the factory's unknown-type case (get_debug_type todo!()) are marked #[ignore]. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: port small leaf tests (config, filters, platform, formatter)nsfisis
Port DefaultConfigTest, IgnoreAll/IgnoreNothingPlatformRequirementFilterTest, PlatformTest, GitExcludeFilterTest, and HtmlOutputFormatterTest. Each PHP Test/<Subdir>/ maps to a single integration-test binary via tests/<dir>/main.rs (the target is named after the directory) whose #[test] functions are collected from the module tree. Tests that exercise unported library behavior (regex backreferences, Preg::split, env expansion) are marked #[ignore]. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>