Created
August 22, 2012 09:25
-
-
Save bamarni/3424003 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
public function testIndex() | |
{ | |
$client = static::createClient(); | |
$container = static::$kernel->getContainer(); | |
$client->getCookieJar()->set(new \Symfony\Component\BrowserKit\Cookie($container->get('session')->getName(), true)); | |
$token = new UsernamePasswordToken('admin', null, 'secured_area', array('ROLE_ADMIN')); | |
$container->get('security.context')->setToken($token); | |
$container->get('session')->set('_security_secured_area', serialize($token)); | |
$client->request('GET', '/admin/artist/'); | |
$this->assertTrue($client->getResponse()->isSuccessful()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you have a bundle I can use to run this test. I want to replicate your environment exactly.