Skip to content

Commit 119676f

Browse files
committed
fix(embed): change sapi tests to outer macro pattern
Refs: #335
1 parent 11e0d20 commit 119676f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

tests/sapi.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use ext_php_rs::ffi::{
88
php_module_shutdown, php_module_startup, php_request_shutdown, php_request_startup,
99
sapi_shutdown, sapi_startup, ZEND_RESULT_CODE_SUCCESS,
1010
};
11-
use ext_php_rs::prelude::*;
1211
use ext_php_rs::zend::try_catch_first;
12+
use ext_php_rs::{php_module, prelude::*};
1313
use std::ffi::c_char;
1414

1515
static mut LAST_OUTPUT: String = String::new();
@@ -82,17 +82,15 @@ fn test_sapi() {
8282
}
8383
}
8484

85-
/// Gives you a nice greeting!
86-
///
87-
/// @param string $name Your name.
88-
///
89-
/// @return string Nice greeting!
90-
#[php_function]
91-
pub fn hello_world(name: String) -> String {
92-
format!("Hello, {}!", name)
93-
}
94-
9585
#[php_module]
96-
pub fn module(module: ModuleBuilder) -> ModuleBuilder {
97-
module
86+
mod module {
87+
/// Gives you a nice greeting!
88+
///
89+
/// @param string $name Your name.
90+
///
91+
/// @return string Nice greeting!
92+
#[php_function]
93+
pub fn hello_world(name: String) -> String {
94+
format!("Hello, {}!", name)
95+
}
9896
}

0 commit comments

Comments
 (0)