Skip to content

Instantly share code, notes, and snippets.

@everzet
Created December 22, 2011 08:56
Show Gist options
  • Save everzet/1509593 to your computer and use it in GitHub Desktop.
Save everzet/1509593 to your computer and use it in GitHub Desktop.
Install & use Behat+Mink with ALL dependencies through Composer
{
"require": {
"behat/behat": ">=2.2.2",
"behat/mink": ">=1.3.2"
},
"repositories": {
"behat/mink-deps": { "composer": { "url": "behat.org" } }
}
}
#!/bin/sh
wget -nc http://getcomposer.org/composer.phar
php composer.phar install
# after that, just run behat with:
# vendor/bin/behat
#
# this vendor/bin/behat already knows where to find MinkContext
# and all it's dependencies automagically ;-)
@Seldaek
Copy link

Seldaek commented Dec 22, 2011

BTW you can add: "config": { "bin-dir": "bin/" } to have them linked as bin/behat instead of vendor/bin/behat.

@willdurand
Copy link

👍

@everzet
Copy link
Author

everzet commented Dec 22, 2011

@Seldaek yeah, i know. But i want to impress people with composer.json shortness ;-)

@collinlavoie
Copy link

Obtained error:

[UnexpectedValueException]
Repository behat/mink-deps ({"composer":{"url":"behat.org"}}) must have a type defined

I had to change the repositories as so:

"repositories": {
    "behat/mink-deps": { 
        "type": "composer",
        "url": "behat.org" }
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment