You are here

public function ClientTest::testReload in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/browser-kit/Tests/ClientTest.php \Symfony\Component\BrowserKit\Tests\ClientTest::testReload()

File

vendor/symfony/browser-kit/Tests/ClientTest.php, line 536

Class

ClientTest

Namespace

Symfony\Component\BrowserKit\Tests

Code

public function testReload() {
  $client = new TestClient();
  $parameters = array(
    'foo' => 'bar',
  );
  $files = array(
    'myfile.foo' => 'baz',
  );
  $server = array(
    'X_TEST_FOO' => 'bazbar',
  );
  $content = 'foobarbaz';
  $client
    ->request('GET', 'http://www.example.com/foo/foobar', $parameters, $files, $server, $content);
  $client
    ->reload();
  $this
    ->assertEquals('http://www.example.com/foo/foobar', $client
    ->getRequest()
    ->getUri(), '->reload() reloads the current page');
  $this
    ->assertArrayHasKey('foo', $client
    ->getRequest()
    ->getParameters(), '->reload() keeps parameters');
  $this
    ->assertArrayHasKey('myfile.foo', $client
    ->getRequest()
    ->getFiles(), '->reload() keeps files');
  $this
    ->assertArrayHasKey('X_TEST_FOO', $client
    ->getRequest()
    ->getServer(), '->reload() keeps $_SERVER');
  $this
    ->assertEquals($content, $client
    ->getRequest()
    ->getContent(), '->reload() keeps content');
}