aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/autoload/class_loader_test.rs
blob: 68a0ba49f273b360ca6be39413c1ef38085dd63c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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!()
}