Steps to reproduce:

Given that I have checkout out the "master" branch
And I run "behat -dl"
Then I should NOT see "[ReflectionException] Class Drupal\Drupal does not exist"

Work-around to produce expected results:

Given that I edit "composer/autoload_namespaces.php"
And I add the line "'Drupal\\' => array($vendorDir . '/drupal/drupal-extension/src'),"
And I run "behat -dl"
Then I see a complete list of behat phrases.

I think I shouldn't need to manually edit autoload_namespaces.php, so there's probably something wrong with your composer.json file, but I don't know enough about composer to guess the proper fix.

Comments

jhedstrom’s picture

Great use of Behat syntax for the bug report! Could you attach the copy of the composer.json file you are using to build your project?

matt2000’s picture

As requested....

{
    "require": {
        "behat/mink": "1.4@stable",
        "behat/mink-goutte-driver": "*",
        "behat/mink-selenium2-driver": "*",
        "behat/behat": "2.4@stable",
        "behat/mink-extension": "*",
        "drupal/drupal-extension": "*"
    },
    "minimum-stability": "dev",
    "config": {
        "bin-dir": "bin/"
    }
}
  
matt2000’s picture

So I just tried starting from scratch, using the composer.json file form this project page, and everything worked as it should.

If it's not obvious from the above, I had originally had a working behat install without the Drupal Extension, and tried to add it to to my existing composer.json.

jhedstrom’s picture

Hmm, at a glance, the composer.json file in #2 should work. I'll see if I can reproduce the issue.

nielsonm’s picture

@matt2000 Without your behat.yml file, I'm unable to completely debug this error. However you might look into updating your mink and behat versions to a more recent release. Let me know if that works.

jhedstrom’s picture

Issue summary: View changes
Status: Active » Closed (cannot reproduce)