Skip to content

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Dec 22, 2019

@jrfnl jrfnl added Type: enhancement PR: quick merge PR only contains relatively simple changes PR: ready for review labels Dec 22, 2019
@jrfnl jrfnl added this to the 9.x Next milestone Dec 22, 2019
@jrfnl jrfnl requested a review from wimg December 22, 2019 01:57
@wimg wimg merged commit d9aa4b4 into develop Dec 26, 2019
@wimg wimg deleted the php-7.4/add-ffi-extension-detection branch December 26, 2019 21:05
@jrfnl jrfnl removed PR: quick merge PR only contains relatively simple changes PR: ready for review labels Dec 26, 2019
FFI::load(__DIR__ . "/dummy.h");
function FFITypeHints( FFI\CData $a, FFI\CType $b );
try {
} catch ( FFI\Exception | FFI\ParserException $e ) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

require says php 5.4 is used in this project:

perhaps you need PHP 7.1 in "require-dev" to indicate that tests need higher version of PHP runtime??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Copy link
Member Author

@jrfnl jrfnl May 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants