StatusCodeTest.php 744 B

12345678910111213141516171819202122
  1. <?php
  2. namespace Behat\Mink\Tests\Driver\Basic;
  3. use Behat\Mink\Tests\Driver\TestCase;
  4. class StatusCodeTest extends TestCase
  5. {
  6. public function testStatuses()
  7. {
  8. $this->getSession()->visit($this->pathTo('/index.html'));
  9. $this->assertEquals(200, $this->getSession()->getStatusCode());
  10. $this->assertEquals($this->pathTo('/index.html'), $this->getSession()->getCurrentUrl());
  11. $this->getSession()->visit($this->pathTo('/404.php'));
  12. $this->assertEquals($this->pathTo('/404.php'), $this->getSession()->getCurrentUrl());
  13. $this->assertEquals(404, $this->getSession()->getStatusCode());
  14. $this->assertEquals('Sorry, page not found', $this->getSession()->getPage()->getContent());
  15. }
  16. }