diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-21 03:51:59 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-21 03:51:59 +0900 |
| commit | 27b73a9d4e27027bd34c0068989ce0609bdc6e9f (patch) | |
| tree | d23681a1a78ba3c75d8b3eff738a0ad10c50f926 /crates/shirabe/tests/autoload | |
| parent | 25d368d3edf77fe9833c7d2cdefc6242cfec8ebe (diff) | |
| download | php-shirabe-27b73a9d4e27027bd34c0068989ce0609bdc6e9f.tar.gz php-shirabe-27b73a9d4e27027bd34c0068989ce0609bdc6e9f.tar.zst php-shirabe-27b73a9d4e27027bd34c0068989ce0609bdc6e9f.zip | |
test: port ClassLoader/HttpDownloader/Reinstall command tests
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>
Diffstat (limited to 'crates/shirabe/tests/autoload')
| -rw-r--r-- | crates/shirabe/tests/autoload/class_loader_test.rs | 25 | ||||
| -rw-r--r-- | crates/shirabe/tests/autoload/main.rs | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/crates/shirabe/tests/autoload/class_loader_test.rs b/crates/shirabe/tests/autoload/class_loader_test.rs index 02fb48f..68a0ba4 100644 --- a/crates/shirabe/tests/autoload/class_loader_test.rs +++ b/crates/shirabe/tests/autoload/class_loader_test.rs @@ -1 +1,26 @@ //! ref: composer/tests/Composer/Test/Autoload/ClassLoaderTest.php + +use shirabe::autoload::class_loader::ClassLoader; + +// In PHP, loadClass() includes the matching .php fixture and the assertion checks +// class_exists(). There is no equivalent runtime notion of loading and defining a +// class in Rust, so this case cannot be ported faithfully. +#[test] +#[ignore = "relies on PHP loadClass()/class_exists() runtime class loading, which has no Rust equivalent"] +fn test_load_class() { + todo!() +} + +#[test] +fn test_get_prefixes_with_no_psr0_configuration() { + let loader = ClassLoader::new(None); + assert!(loader.get_prefixes().is_empty()); +} + +// In PHP this serializes the loader and unserializes it, then compares every getter. +// PHP serialize()/unserialize() has no Rust equivalent here. +#[test] +#[ignore = "relies on PHP serialize()/unserialize() round-tripping of the ClassLoader, which is not ported"] +fn test_serializability() { + todo!() +} diff --git a/crates/shirabe/tests/autoload/main.rs b/crates/shirabe/tests/autoload/main.rs new file mode 100644 index 0000000..769d9e8 --- /dev/null +++ b/crates/shirabe/tests/autoload/main.rs @@ -0,0 +1 @@ +mod class_loader_test; |
