-
Notifications
You must be signed in to change notification settings - Fork 6
Add unit tests #4
Comments
I've tried to add following test: class WUnitDriverTest extends HeadlessDriverTest
{
protected static function getDriver()
{
\Yii::setApplication(\WUnit\WUnit::createWebApplication());
return new WUnitDriver();
}
} This didn't work. I've figured out, that I need some kind of Yii application that would represent website with web fixtures. Also I've added dependency to Yii framework in composer.json, since otherwise I've just got missing classes error. |
The only unit test would be for testing the constructor. |
Same as MinkGoutteDriver. We're just testing, that used Client class really does fetch pages and do MinkBrowserKitDriver operations on them. Besides, does it curl pages as Goutte driver or not? |
No, it's one step further to having a headless browser emulator, as it DIRECTLY calls the Yii application. |
Yii framework should only be a dependency for testing, otherwise we'll sure have conflicts. This as most users probably still do NOT install Yii the composer way (like myself), thus they end up with a directory structure like:
Having Yii as MinkWUnitDriver dependency by default would end up in having Yii present twice. |
As dev dependency only of course. If you're willing to add missing tests, then you're welcome. |
Looking at https://github.com/weavora/wunit guys, they already have quite some tests.
This way the testing is covered by the weavora/wunit repo. |
See weavora/wunit#12 for the first point. However, this package seems quite unmaintained. Except for a few readme changes, the last update was 2 years ago |
You are right, and I just saw that I already placed an Issue there about getting the package composer ready - no answer so far. |
@patrickdreyer I don't think it makes sense to maintain WUnit in its own repo in the Behat organization. It is something specific to Yii, which is not used by any of the core team AFAIK (I might be wrong here though). Either a maintained version of WUnit with proper composer support appears in another orga (or on a personal account for that matter), or I suggest keeping the code inside the driver repo itself. |
Thanks for your thoughts @stof.
|
@patrickdreyer do you have any news about the composer support in WUnit itself to relu on their package rather than duplicating it ? |
I created a separate issue to discuss about running the driver testsuite as this discussion is talking about the tests for WUnit itself: #9 |
Right now there are no unit tests or Travis CI integration, which makes it pretty hard to safely make changes to the driver code.
@patrickdreyer can you please add tests (I'm guessing this will be similar to ones, done in MinkGoutteDriver, where MinkBrowserKitDriver tests are executed).
The text was updated successfully, but these errors were encountered: