drupalextension icon indicating copy to clipboard operation
drupalextension copied to clipboard

writing tests for drush updb --yes

Open mfb opened this issue 8 years ago • 2 comments

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 avatar Jun 29 '17 00:06 mfb

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

aronbeal avatar Aug 21 '17 22:08 aronbeal

Closing this out. Feel free to re-open for further discussion.

jhedstrom avatar Dec 19 '17 00:12 jhedstrom