Version 1
[yaffs-website] / vendor / behat / mink-goutte-driver / tests / Custom / InstantiationTest.php
diff --git a/vendor/behat/mink-goutte-driver/tests/Custom/InstantiationTest.php b/vendor/behat/mink-goutte-driver/tests/Custom/InstantiationTest.php
new file mode 100644 (file)
index 0000000..db75a18
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+namespace Behat\Mink\Tests\Driver\Custom;
+
+use Behat\Mink\Driver\GoutteDriver;
+
+class InstantiationTest extends \PHPUnit_Framework_TestCase
+{
+    public function testInstantiateWithClient()
+    {
+        $client = $this->getMockBuilder('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());
+    }
+}