Created
May 25, 2012 08:10
-
-
Save MattKetmo/2786531 to your computer and use it in GitHub Desktop.
Quick (and dirty) fix for running tests using FosFacebookBundle
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 | |
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