db75a184b5f5a64cd71129ee238439fb3a11bd4e
[yaffs-website] / vendor / behat / mink-goutte-driver / tests / Custom / InstantiationTest.php
1 <?php
2
3 namespace Behat\Mink\Tests\Driver\Custom;
4
5 use Behat\Mink\Driver\GoutteDriver;
6
7 class InstantiationTest extends \PHPUnit_Framework_TestCase
8 {
9     public function testInstantiateWithClient()
10     {
11         $client = $this->getMockBuilder('Goutte\Client')->disableOriginalConstructor()->getMock();
12         $client->expects($this->once())
13             ->method('followRedirects')
14             ->with(true);
15
16         $driver = new GoutteDriver($client);
17
18         $this->assertSame($client, $driver->getClient());
19     }
20
21     public function testInstantiateWithoutClient()
22     {
23         $driver = new GoutteDriver();
24
25         $this->assertInstanceOf('Behat\Mink\Driver\Goutte\Client', $driver->getClient());
26     }
27 }