BaseUrlTest.php 731 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace Behat\Mink\Tests\Driver\Custom;
  3. use Behat\Mink\Driver\BrowserKitDriver;
  4. use Behat\Mink\Session;
  5. use Behat\Mink\Tests\Driver\Util\FixturesKernel;
  6. use PHPUnit\Framework\TestCase;
  7. use Symfony\Component\HttpKernel\Client;
  8. /**
  9. * @group functional
  10. */
  11. class BaseUrlTest extends TestCase
  12. {
  13. public function testBaseUrl()
  14. {
  15. $client = new Client(new FixturesKernel());
  16. $driver = new BrowserKitDriver($client, 'http://localhost/foo/');
  17. $session = new Session($driver);
  18. $session->visit('http://localhost/foo/index.html');
  19. $this->assertEquals(200, $session->getStatusCode());
  20. $this->assertEquals('http://localhost/foo/index.html', $session->getCurrentUrl());
  21. }
  22. }