You are here

public function StatusCodeTest::testStatuses in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/behat/mink/driver-testsuite/tests/Basic/StatusCodeTest.php \Behat\Mink\Tests\Driver\Basic\StatusCodeTest::testStatuses()

File

vendor/behat/mink/driver-testsuite/tests/Basic/StatusCodeTest.php, line 9

Class

StatusCodeTest

Namespace

Behat\Mink\Tests\Driver\Basic

Code

public function testStatuses() {
  $this
    ->getSession()
    ->visit($this
    ->pathTo('/index.html'));
  $this
    ->assertEquals(200, $this
    ->getSession()
    ->getStatusCode());
  $this
    ->assertEquals($this
    ->pathTo('/index.html'), $this
    ->getSession()
    ->getCurrentUrl());
  $this
    ->getSession()
    ->visit($this
    ->pathTo('/404.php'));
  $this
    ->assertEquals($this
    ->pathTo('/404.php'), $this
    ->getSession()
    ->getCurrentUrl());
  $this
    ->assertEquals(404, $this
    ->getSession()
    ->getStatusCode());
  $this
    ->assertEquals('Sorry, page not found', $this
    ->getSession()
    ->getPage()
    ->getContent());
}