Skip to content

Instantly share code, notes, and snippets.

@ss23
Created May 25, 2013 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ss23/5647935 to your computer and use it in GitHub Desktop.
Save ss23/5647935 to your computer and use it in GitHub Desktop.
<?php
public function testUserAgentLockout() {
// Set our user-agent
$_SERVER['HTTP_USER_AGENT'] = 'Test Agent';
// Create an admin session
$session = new Session(array('loggedInAs' => $this->logInWithPermission()));
// Make a test request and confirm it works
$response = Director::test('admin/pages', null, $session);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment