Application\Sonata\UserBundle\Tests\Functional\LoginTest::testLogginIn PHP Method

testLogginIn() public method

public testLogginIn ( )
    public function testLogginIn()
    {
        $client = $this->getClient();
        $client->followRedirects(true);
        $crawler = $client->request('GET', '/admin/dashboard');
        /** @var $super_admin \Application\Sonata\UserBundle\Entity\User */
        $super_admin = $this->getReferenceRepository()->getReference('user.super_admin');
        $data = array('_username' => $super_admin->getUsername(), '_password' => 'test');
        $form = $crawler->selectButton('Login')->form();
        $crawler = $client->submit($form, $data);
        $this->assertGreaterThan(0, $crawler->filter('html:contains("Users")')->count());
    }