Closed agallou closed 8 years ago
@agallou could you add a changelog entry please ?
Sorry but the API looks horrible :-/. Why not simply: php >= 7
instead of phpVersionConstraint.hasGte(7)
? This is almost unreadable :-(.
@Hywan there could be more that one php version constaint on an atoum test.
@agallou php >=7 and php < 7.2
?
In the test, the constaint could be :
/**
* @php >= 7.0
* @php < 7.2
*/
or :
/**
* @php = 5.5
* @php = 7.0
*/
For now, the PR filters on the constraint not the php version were the test could be executed. We search if the test has in the pphdoc the constraint provided in the filter.
@Hywan could you explain what the php >=7 and php < 7.2
filter will do ?
@agallou It will select the test cases with @php >= 7.0 @php < 7.2
constraints.
I don't see how we can achive that kind of filter. We have to constraint (the one in atoum and the one passed to the ruler), and no finite list of PHP versions.
@agallou Yes, that would be difficult without overloading the <
, >
& co. operators. But, what about a php_version
function instead? Like this: php_version('>', 7.0)
for instance… hmm, it reads bad. I don't know how to do exactly, but phpVersionConstraint.hasGt
looks horrible for me :-/. Am I the only one?
has seen or IRC, there is no concrete case. We'll reopen it when it will be the case.
Even if I think the feature is interesting, it has to be well crafted. The proposed API is not my main concern here.
Look, when a test is tagged with some PHP version it means it can only run on those specific versions. It makes no sense to filter on test targeting php >= 5.5.0
when we run a PHP 5.4 CLI for example.
To me, the only valid use case would be a filter to only run test tagged with the currently used PHP version: if I run a 5.5 CLI, it will only run test matching this version.
BTW, if you still want this feature, here is what I propose to clean the arguments: --filter 'phpVersion includes "7.0.1"'
which will run all tests with a constraint including the provided version.
We will now be able to limit the tests launched, on the php version constraint.
For exemple :
phpVersionConstraint.containsGte("7.0")
.