From 4596301290d7c3e8fef3d1240cd895e8ddb526c2 Mon Sep 17 00:00:00 2001 From: Ulrich Eckhardt Date: Mon, 13 Feb 2023 16:14:05 +0100 Subject: [PATCH] FFI Stubs: Define a set of tests. Mostly, those are derived from examples from the documentation. --- tests/FFITest.php | 87 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 tests/FFITest.php diff --git a/tests/FFITest.php b/tests/FFITest.php new file mode 100644 index 000000000..d31986814 --- /dev/null +++ b/tests/FFITest.php @@ -0,0 +1,87 @@ + [ + 'code' => 'printf("Hello %s!\n", "world"); + ', + 'assertions' => [], + 'ignored_issues' => [], + 'php_version' => '7.4', + ], + 'Example #3 Accessing existing C variables' => [ + 'code' => 'errno; + ', + 'assertions' => [], + 'ignored_issues' => [], + 'php_version' => '7.4', + ], + 'Example #5 Working with C arrays' => [ + 'code' => ' [], + 'ignored_issues' => [], + 'php_version' => '7.4', + ], + 'Example #6 Working with C enums' => [ + 'code' => 'ZEND_FFI_SYM_TYPE; + echo $a->ZEND_FFI_SYM_CONST; + echo $a->ZEND_FFI_SYM_VAR; + ', + 'assertions' => [], + 'ignored_issues' => [], + 'php_version' => '7.4', + ], + ]; + } +}