hi guys, just noticed that there is Behat / YiiExtension in the official Behat github account, it looks like demostration of how to integrate behat with “other frameworks” (see this everzet’s post) rather than ready-to-use yii extension, but anyway it should help you
btw, I didn’t use behat with yii, but it shouldn’t be a problem just to run behat on yii project: you just need to configure autoloader and provide yii app instance for the behat context
I’d actually recommend using Codeception these days (http://codeception.com). It runs over top of Behat / Mink and has fairly decent Yii support (and at least partial backing of some well known Yii guys).
Sadly, I don’t have any instructions on integrating Mink and I did Behat stuff about 9 months ago, it wasn’t working perfectly and I don’t remember very clearly what I did :-). Hence the suggestion about Codeception, as they have good instructions and handle a lot of that for you.
I have managed to get Mink working in Yii by including vendor/autoload.php and then fully qualify a couple of classes I needed to instantiate on my code. The rest of the classes Mink needed were found by it automatically. So I now have it working.
@Samdark do you mean basic yii app? basic Mink app? (via composer, for example). Yii if obviously working and I’ve created an extension to encapsulate Mink integration details but after including Mink’s autoloader like this (and I’ve tried many many other options… )
$driver = new SahiDriver('phantomjs');
It didn’t work and I got an exception (IIRC) from php that complained that it could not locate the SahiDriver class.
After I changed the instantiation to fully qualified identifier with namespace, it worked:
$driver = new Behat\Mink\Driver\SahiDriver('phantomjs');
EDIT: just to complete the information, the other needed line is a ‘require’ statement:
</div><div>// obviously - update to your path</div><div>require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'vendor/autoload.php';</div><div>