I am having an issue with Mink+Zombie. It all started with me not being able to visit a page. I tried a million times with a dozen sites, and always got:
PHP Fatal error: Uncaught exception 'Behat\Mink\Exception\DriverException' with message 'Could not load resource for URL 'http://www.grahamc.com'' in /Users/travisblack/Sites/nationalfield/lib/vendor/Mink/src/Behat/Mink/Driver/ZombieDriver.php:170
I removed the !empty check from the Zombie driver, and tried, then readded the check, and to my surprise, I got different results, but I think it is a result of caching. Now, I am able to visit a page, and get a response, but there seems to be no content in the pages, ie:
<?php
require_once __DIR__ . '/../lib/vendor/Mink/autoload.php';
$driver = new \Behat\Mink\Driver\ZombieDriver();
// init session:
$session = new \Behat\Mink\Session($driver);
// start session:
$session->start();
$session->visit('http://testing.nf.localhost/frontend_dev.php');
// get the current page URL:
echo $session->getCurrentUrl();
// get the response status code:
echo $session->getStatusCode();
// get page content:
echo $session->getPage()->getContent();
returns http://testing.nf.localhost/frontend_dev.php200
but doesn't return any content from the page.
When testing in an actual scenario, I tried:
@mink:zombie
Feature: app
In order to use NationalField
As a user with a browser
I need to be able to access the NationalField site
Scenario: Access the login page
Given I am on "/"
When I reload the page
Then I should see "Welcome back"
But it returns:
Feature: app
In order to use NationalField
As a user with a browser
I need to be able to access the NationalField site
@mink:zombie
Scenario: Access the login page # features/app.feature:7
Given I am on "/" # FeatureContext::visit()
When I reload the page # FeatureContext::reload()
Then I should see "Welcome back" # FeatureContext::assertPageContainsText()
Argument #2 of PHPUnit_Framework_Assert::assertContains() must be a array, iterator or string
Again, hinting that the page is empty.