public function __construct($deployed_api_key, $deployed_secret) { /* * Read the basic context configuration; defer configuring the application's API key * and secret until Channel configuration */ $source = null; if (isset($_POST[$name])) { $source =& $_POST; } else { if (isset($_GET[$name])) { $source =& $_GET; } } $context_params = self::readContext($source); $signer = new NetworkFacebookSigner(); if (isset($source['fb_sig']) && $signer->sign($context_params, $deployed_secret) == $source['fb_sig']) { } }
/** * @dataProvider provideForSigning */ public function testSigning($params, $secret, $msg) { $s = new NetworkFacebookSigner(); $sig = $s->sign($params, $secret); $this->assertEquals(Facebook::generate_sig($params, $secret), $sig, $msg . ' test case'); }