Skip to content

Commit 9a31a37

Browse files
committed
chore(test): fix embed test on php 8.4
1 parent e176cbd commit 9a31a37

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/embed/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ mod tests {
255255
#[test]
256256
#[should_panic]
257257
fn test_panic() {
258-
Embed::run(|| {
258+
Embed::run::<(), _>(|| {
259259
panic!("test panic");
260260
});
261261
}

tests/module.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ use ext_php_rs::prelude::*;
1010
fn test_module() {
1111
Embed::run(|| {
1212
// Allow to load the module
13-
unsafe { zend_register_module_ex(get_module()) };
13+
cfg_if::cfg_if! {
14+
if #[cfg(php84)] {
15+
unsafe { zend_register_module_ex(get_module(), 2) };
16+
} else {
17+
unsafe { zend_register_module_ex(get_module()) };
18+
}
19+
}
1420

1521
let result = Embed::eval("$foo = hello_world('foo');");
1622

0 commit comments

Comments
 (0)