3 namespace Zumba\GastonJS\Tests;
6 * Class BrowserAuthenticationTest
7 * @package Zumba\GastonJS\Tests\Server
9 class BrowserAuthenticationTest extends BrowserCommandsTestCase {
11 public function testAuthenticationFails() {
12 $this->visitUrl($this->getTestPageBaseUrl() . "/basic-auth-required/");
13 $this->assertEquals(401, $this->browser->getStatusCode());
14 $this->assertContains("NOT_AUTHORIZED", $this->browser->getBody());
17 public function testAuthenticationSuccess() {
18 $this->browser->setHttpAuth("test", "test");
19 $this->visitUrl($this->getTestPageBaseUrl() . "/basic-auth-required/");
20 $this->assertEquals(200, $this->browser->getStatusCode());
21 $this->assertContains("AUTHORIZATION_OK", $this->browser->getBody());