Skip to content

[Feature-Request] Use Mage:: in a Behat-Hook #91

@zuernBernhard

Description

@zuernBernhard

I have a behat test for the Customer-Registration in a Magento-Shop (1.8).

In order to rerun the test as often as I want
As a developer I want the Test to clear the generated user account in a scenario hook

Possible Solution:

/**
   * @param $event
   *
   * @BeforeScenario
   */
  public function before($event) {
    if ('Customer Register' == $event->getScenario()->getTitle()) {
      // Delete the TestCustomer if exists.
      $customer = Mage::getModel('customer/customer')->loadByEmail('email@dre.ss');
      $customer->delete();
    }
  }

BUT this does not work.

Then I move the code into a Stepdefinition it works. :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions