Prezioso
Prezioso

Reputation: 171

Missing extension in Behat/mink/laravel

I'm having a lot of trouble with setting up behat + mink for my laravel project.

The error msg:

PHP Deprecated:  The ability to pass file names to Yaml::parse() was deprecated in 2.7
and will be removed in 3.0. Please, pass the contents of the file instead. in 
home/user/projects/php/projectname/vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php
on line 58

[Behat\Testwork\ServiceContainer\Exception\ExtensionInitializationException]    
`Behat\MinkExtensions\Extension` extension file or class could not be located. 

My composer.json:

"require": {
    "laravel/framework": "4.2.*",
    "behat/behat": "~3.0.6",
    "behat/mink": "1.6.*",                                                 
    "behat/mink-goutte-driver": "*",
    "behat/mink-selenium-driver": "*",
    "behat/mink-selenium2-driver": "*",
    "behat/mink-sahi-driver": "*",
    "behat/mink-zombie-driver": "*"

My behat.yml (located in the root of the project)

default:
    extensions:
        Behat\MinkExtensions\Extension:
            goutte: ~

I've tried different versions, but still same error msg.

The commands I've run are:

./vendor/bin/behat --init
./vendor/bin/behat

But produces same msg.

Upvotes: 2

Views: 1276

Answers (1)

Prezioso
Prezioso

Reputation: 171

https://github.com/Behat/MinkExtension/blob/master/doc/index.rst

Reading the above solved the problem and the behat.yml should look like this.

# behat.yml
default:
  # ...
   extensions:
    Behat\MinkExtension:
      base_url:  'http://example.com'
      sessions:
        default:
          goutte: ~

Upvotes: 2

Related Questions