diff --git a/tests/commonjs_modules_caching.phpt b/tests/commonjs_caching_001.phpt similarity index 100% rename from tests/commonjs_modules_caching.phpt rename to tests/commonjs_caching_001.phpt diff --git a/tests/commonjs_caching_002.phpt b/tests/commonjs_caching_002.phpt new file mode 100644 index 0000000..bdc34b2 --- /dev/null +++ b/tests/commonjs_caching_002.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test V8Js::setModuleLoader : module cache seperated per isolate +--SKIPIF-- + +--FILE-- +setModuleLoader(function($module) { + print("setModuleLoader called for ".$module."\n"); + return 'exports.bar = 23;'; +}); + +$v8two = new V8Js(); +$v8two->setModuleLoader(function($module) { + print("setModuleLoader called for ".$module."\n"); + return 'exports.bar = 23;'; +}); + +$v8->executeString($JS, 'module.js'); +echo "--- v8two ---\n"; +$v8two->executeString($JS, 'module.js'); +?> +===EOF=== +--EXPECT-- +setModuleLoader called for test +--- v8two --- +setModuleLoader called for test +===EOF===