Skip to content

Merged and improved the articles about testing + authentication #7507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 15, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improved a test
  • Loading branch information
javiereguiluz committed Apr 15, 2017
commit be5fe37f53f82d36c634ed59a9cede214bb22a89
3 changes: 2 additions & 1 deletion testing/http_authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ needs::

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;

class DefaultControllerTest extends WebTestCase
Expand All @@ -101,7 +102,7 @@ needs::
$this->logIn();
$crawler = $this->client->request('GET', '/admin');

$this->assertTrue($this->client->getResponse()->isSuccessful());
$this->assertSame(Response::HTTP_OK, $this->client->getResponse());
$this->assertSame('Admin Dashboard', $crawler->filter('h1')->text());
}

Expand Down