Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #40 from stof/extra_tests
Browse files Browse the repository at this point in the history
Added tests covering the 2 ways to instantiate the driver
  • Loading branch information
stof committed May 2, 2014
2 parents 9c84852 + 78edf78 commit 8bf4129
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions tests/Behat/Mink/Driver/ExtraDriverTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Tests\Behat\Mink\Driver;

use Behat\Mink\Driver\GoutteDriver;

/**
* @group unit
*/
class ExtraDriverTest extends \PHPUnit_Framework_TestCase
{
public function testInstantiateWithClient()
{
$client = $this->getMockBuilder('Behat\Mink\Driver\Goutte\Client')->disableOriginalConstructor()->getMock();
$client->expects($this->once())
->method('followRedirects')
->with(true);

$driver = new GoutteDriver($client);

$this->assertSame($client, $driver->getClient());
}

public function testInstantiateWithoutClient()
{
$driver = new GoutteDriver();

$this->assertInstanceOf('Behat\Mink\Driver\Goutte\Client', $driver->getClient());
}
}
2 changes: 1 addition & 1 deletion tests/Behat/Mink/Driver/GoutteDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Behat\Mink\Driver\GoutteDriver;

/**
* @group gouttedriver
* @group functional
*/
class GoutteDriverTest extends GeneralDriverTest
{
Expand Down

0 comments on commit 8bf4129

Please sign in to comment.