Skip to content

Instantly share code, notes, and snippets.

@bamarni
Created August 22, 2012 09:25
Show Gist options
  • Save bamarni/3424003 to your computer and use it in GitHub Desktop.
Save bamarni/3424003 to your computer and use it in GitHub Desktop.
<?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());
}
Copy link

ghost commented Aug 31, 2012

Do you have a bundle I can use to run this test. I want to replicate your environment exactly.

Copy link

ghost commented Aug 31, 2012

You can contact me on drak / zikula.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment