BaseUrlTest.php 679 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<?php

namespace Behat\Mink\Tests\Driver\Custom;

use Behat\Mink\Driver\BrowserKitDriver;
use Behat\Mink\Session;
use Symfony\Component\HttpKernel\Client;

/**
 * @group functional
 */
class BaseUrlTest extends \PHPUnit_Framework_TestCase
{
    public function testBaseUrl()
    {
        $client = new Client(require(__DIR__.'/../app.php'));
        $driver = new BrowserKitDriver($client, 'http://localhost/foo/');
        $session = new Session($driver);

        $session->visit('http://localhost/foo/index.html');
        $this->assertEquals(200, $session->getStatusCode());
        $this->assertEquals('http://localhost/foo/index.html', $session->getCurrentUrl());
    }
}