InstantiationTest.php 714 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Behat\Mink\Tests\Driver\Custom;
  3. use Behat\Mink\Driver\GoutteDriver;
  4. class InstantiationTest extends \PHPUnit_Framework_TestCase
  5. {
  6. public function testInstantiateWithClient()
  7. {
  8. $client = $this->getMockBuilder('Goutte\Client')->disableOriginalConstructor()->getMock();
  9. $client->expects($this->once())
  10. ->method('followRedirects')
  11. ->with(true);
  12. $driver = new GoutteDriver($client);
  13. $this->assertSame($client, $driver->getClient());
  14. }
  15. public function testInstantiateWithoutClient()
  16. {
  17. $driver = new GoutteDriver();
  18. $this->assertInstanceOf('Behat\Mink\Driver\Goutte\Client', $driver->getClient());
  19. }
  20. }