Problem: The module has to be enabled for the whole test suite in order to use it for couple of Scenarios. When using the subcontext the DatetimeTestingContext is included and the DatetimeTestingContext::resetTime() is being executed after every scenario due to the tag @AfterScenario. If the module is not enabled, we get an error:
AfterScenario # DatetimeTestingContext::resetTime()
Fatal error: Call to undefined method Drupal\Component\Datetime\Time::resetTime() (Behat\Testwork\Call\Exception\FatalThrowableError)
Motivation: In our project we would like to have the freedom to enable the module on demand and being able to disable when it is not required.
Solution: I have provided a patch that checks if the module is enabled when the method is executed in @AfterScenario.
Comments
Comment #2
joevagyok commentedComment #4
ademarco commentedComment #5
ademarco commentedComment #6
ademarco commented