This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/vendor/behat/mink/driver-testsuite/tests/Basic/StatusCodeTest.php

23 lines
744 B
PHP

<?php
namespace Behat\Mink\Tests\Driver\Basic;
use Behat\Mink\Tests\Driver\TestCase;
class StatusCodeTest extends TestCase
{
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());
}
}