diff --git a/tests/integration/src/strings.rs b/tests/integration/src/strings.rs index c62c9ae..2e9875e 100644 --- a/tests/integration/src/strings.rs +++ b/tests/integration/src/strings.rs @@ -25,4 +25,21 @@ pub fn integrate(module: &mut Module) { Ok(()) }, ); + + module.add_function( + "integrate_strings_zend_string_new_persistent", + |_: &mut [ZVal]| -> phper::Result<()> { + let zs = ZString::new_persistent("persistent_hello"); + assert_eq!(zs.to_str()?, "persistent_hello"); + + let zs = ZString::new_persistent([4, 5, 6]); + assert_eq!(zs.as_ref(), &[4, 5, 6]); + + assert!( + ZString::new_persistent("persistent") == ZString::new_persistent(b"persistent") + ); + + Ok(()) + }, + ); } diff --git a/tests/integration/tests/php/strings.php b/tests/integration/tests/php/strings.php index ac6745b..9eb906a 100644 --- a/tests/integration/tests/php/strings.php +++ b/tests/integration/tests/php/strings.php @@ -14,3 +14,4 @@ require_once __DIR__ . '/_common.php'; integrate_strings_zend_string_new(); +integrate_strings_zend_string_new_persistent();