MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / new_test_with_stubs

Method new_test_with_stubs

src/lib.rs:833–841  ·  view source on GitHub ↗

Create a `Backend` for tests with custom stub class index. This allows tests to inject minimal stub content (e.g. `UnitEnum`, `BackedEnum`) without depending on `composer install` having been run.

(stub_index: HashMap<&'static str, &'static str>)

Source from the content-addressed store, hash-verified

831 /// This allows tests to inject minimal stub content (e.g. `UnitEnum`,
832 /// `BackedEnum`) without depending on `composer install` having been run.
833 pub fn new_test_with_stubs(stub_index: HashMap<&'static str, &'static str>) -> Self {
834 virtual_members::phpdoc::clear_mixin_cache();
835 let backend = Self {
836 stub_index: RwLock::new(stub_index),
837 ..Self::test_defaults()
838 };
839 backend.set_php_version(backend.php_version());
840 backend
841 }
842
843 /// Create a `Backend` for tests with custom class, function, and constant
844 /// stub indices.

Callers

nothing calls this directly

Calls 3

clear_mixin_cacheFunction · 0.85
set_php_versionMethod · 0.80
php_versionMethod · 0.80

Tested by

no test coverage detected