diff --git a/tests/src/integration/globals.php b/tests/src/integration/globals.php new file mode 100644 index 000000000..119845cdd --- /dev/null +++ b/tests/src/integration/globals.php @@ -0,0 +1,8 @@ + &mut ZendObject { a } +// GLOBALS +#[php_function] +pub fn test_globals_http_get() -> ZBox { + ProcessGlobals::get().http_get_vars().to_owned() +} + +#[php_function] +pub fn test_globals_http_post() -> ZBox { + ProcessGlobals::get().http_post_vars().to_owned() +} + +#[php_function] +pub fn test_globals_http_cookie() -> ZBox { + ProcessGlobals::get().http_cookie_vars().to_owned() +} + +#[php_function] +pub fn test_globals_http_server() -> ZBox { + println!("{:?}", ProcessGlobals::get().http_server_vars()); + ProcessGlobals::get().http_server_vars().unwrap().to_owned() +} + +#[php_function] +pub fn test_globals_http_request() -> ZBox { + ProcessGlobals::get() + .http_request_vars() + .unwrap() + .to_owned() +} + +#[php_function] +pub fn test_globals_http_files() -> ZBox { + ProcessGlobals::get().http_files_vars().to_owned() +} + #[php_function] pub fn test_closure() -> Closure { Closure::wrap(Box::new(|a| a) as Box String>) @@ -179,6 +220,7 @@ mod integration { mod callable; mod class; mod closure; + mod globals; mod nullable; mod number; mod object;