Due to the way Drupal\DrupalExtension\Context\Environment\Reader::findSubContextClasses() is currently working, filtering a feature file by line number is broken.
vendor/bin/behat --profile=drupal8 features/d8.feature:7
No scenarios
No steps
4m55.46s (20.82Mb)
In ExerciseController.php line 111:
No specifications found at path(s) `features/d8.feature:7`. This might be because of incorrect paths configuration in your `suites`.
This is because when it loads each driver, if it implements SubDriverFinderInterface, then the getSubDriverPaths() method is called, which in turn bootstraps Drupal, and that changes the current working directory to Drupal. Thus, relative paths like features/d8.feature result in a file not found issue in Behat's PathsFilter::isFeatureMatch() when realpath($feature->getFile()) returns false.
Due to the way
Drupal\DrupalExtension\Context\Environment\Reader::findSubContextClasses()
is currently working, filtering a feature file by line number is broken.This is because when it loads each driver, if it implements
SubDriverFinderInterface
, then thegetSubDriverPaths()
method is called, which in turn bootstraps Drupal, and that changes the current working directory to Drupal. Thus, relative paths likefeatures/d8.feature
result in a file not found issue in Behat'sPathsFilter::isFeatureMatch()
whenrealpath($feature->getFile())
returns false.