drupalextension
drupalextension copied to clipboard
writing tests for drush updb --yes
I had trouble writing a test for drush updb --yes
It seems that the drush output only includes output up to the point where you would type "y" and any following success/ok messages are for some reason not part of the drush output?
@mfb, Have you seen the step @Then drush output should match :regex?
(\Drupal\DrupalExtension\Context\DrushContext::assertDrushOutputMatches). It looks like it is performing pattern matching on drush output, and could provide a pattern for you to emulate.
The following step worked for me (using api_driver: drush):
@api @current
Scenario: test drush
Given I run drush vset "foo 'Foo'"
Given I run drush vdel "foo -y"
Then drush output should contain "foo was deleted"
Closing this out. Feel free to re-open for further discussion.