Skip to content

Instantly share code, notes, and snippets.

@MattKetmo
Created May 25, 2012 08:10
Show Gist options
  • Save MattKetmo/2786531 to your computer and use it in GitHub Desktop.
Save MattKetmo/2786531 to your computer and use it in GitHub Desktop.
Quick (and dirty) fix for running tests using FosFacebookBundle
<?php
namespace Foo\BarBundle\Facebook;
use FOS\FacebookBundle\Facebook\FacebookSessionPersistence as BaseFacebookSessionPersistence;
use Symfony\Component\HttpFoundation\Session\Session;
/**
* Quick (and dirty) fix for running tests using FosFacebookBundle.
* It may have unwanted consequences (not tested)!
*
* In your config.yml:
* fos_facebook:
* class:
* api: Foo\BarBundle\Facebook\FacebookSessionPersistence
*
* @see https://github.com/FriendsOfSymfony/FOSFacebookBundle/issues/79
*/
class FacebookSessionPersistence extends BaseFacebookSessionPersistence
{
public function __construct($config, Session $session, $prefix = self::PREFIX)
{
$this->session = $session;
$this->prefix = $prefix;
// don't start session manually and call grand-parent constructor
call_user_func_array(array('BaseFacebook', '__construct'), array($config));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment