ext-php-rs
ext-php-rs copied to clipboard
feat: integration tests
Implemented a very basic test suite for all Datatypes that can be passed as an argument or returned.
I am not sure what kind of conventions you would like to follow here, so I kept the PHP files very stupid - same with the assertion texts. So we would need to decide on a proper way of how to pass the results from PHP to Rust.
Not a 100% happy how the PHP code is executed using a hardcoded path to the compiled extension. Nontheless, I think that is a good start for the first iteration 👍🏻
@TorstenDittmann how are you feeling about that state of this PR? I may be able to help finish it if you're short on time.
What's the status on this ? I feel like such test would be very helpful when developing this library
What's the status on this ? I feel like such test would be very helpful when developing this library
It's the most critical feature that I want, but this PR is abandoned.
IMHO, I would try to reproduce what php core does with phpt
Yeah, it kinda got abandoned due to many reason.
If there is interest I can spend a weekend to probably create the PR again from scratch 👀
IMHO, I would try to reproduce what php core does with phpt
That would be nice, it could even be used by people creating extension with this lib to test there code.
I think this would be possible if there was a possibility to compile php with code from this library under a new binary, which would also allow to create binary in rust that can execute php code (like a new sapi ?)
That would be nice, it could even be used by people creating extension with this lib to test there code.
I think this would be possible if there was a possibility to compile php with code from this library under a new binary, which would also allow to create binary in rust that can execute php code (like a new sapi ?)
There is this experimental module here https://github.com/php/php-src/tree/master/sapi/embed to produce a single binary with the Zend engine entry point. I did a small PoC with it and Tauri to reproduce what NativePHP does: it works well. Instead of compiling into a whole extension, we could execute the tested code with it
Can you share your PoC with Tauri ? i would be interested in how you did that
I made an example on https://github.com/davidcole1340/ext-php-rs/pull/270
It works great, it even allow to put test directly in the wanted file, i will try to do a wrapper so we can execute code directly in it, thanks for the input @ptondereau about embed this is certainly the best way to go for that