PHP 7.4: Add detection of features from the new FFI extension detection#949
PHP 7.4: Add detection of features from the new FFI extension detection#949
Conversation
| FFI::load(__DIR__ . "/dummy.h"); | ||
| function FFITypeHints( FFI\CData $a, FFI\CType $b ); | ||
| try { | ||
| } catch ( FFI\Exception | FFI\ParserException $e ) {} |
There was a problem hiding this comment.
require says php 5.4 is used in this project:
PHPCompatibility/composer.json
Line 27 in 6b0c6dc
perhaps you need PHP 7.1 in "require-dev" to indicate that tests need higher version of PHP runtime??
There was a problem hiding this comment.
@glensc This is a test case file. The actual code, including the tests need PHP 5.4, but in PHP 5.4. the library should still be able to recognize PHP 7.1 code, that's what the test cases are about.
So the require settings are perfectly ok as they are.
There was a problem hiding this comment.
@jrfnl thanks for the prompt reply, it wasn't self-obvious from file path that it is not an actual test case but fixtures. Maybe rename the files to be in Fixtures directory?
There was a problem hiding this comment.
@glensc The directory layout we use for the tests now, mirrors that of the tests in PHPCS itself. In other words, it's the standard directory layout for PHPCS sniff tests.
The files ending with UnitTest.php are the actual test files.
The files ending with UnitTest.inc are the test case files. These often contain "nonsense" code, including parse errors (annotated as such), to test the sniff handling all situations we could come up with correctly (and throwing the correct error for each).
Commits:
NewIniDirectives: add FFI ini directives
Ref: https://www.php.net/manual/en/ffi.configuration.php
NewClasses: add FFI classes
Ref: https://www.php.net/manual/en/book.ffi.php