This repository was archived by the owner on Jan 13, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +13
-1
lines changed Expand file tree Collapse file tree 4 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 3232 throw new Exception ('The Facebook SDK requires PHP version 5.4 or higher. ' );
3333}
3434
35+ if (defined ('FACEBOOK_SDK_POLYFILLS_LOADED ' ) === false ) {
36+ require_once __DIR__ . 'polyfills.php ' ;
37+ }
38+
3539/**
3640 * Register the autoloader for the Facebook SDK classes.
3741 *
Original file line number Diff line number Diff line change 2222 *
2323 */
2424
25+ define ('FACEBOOK_SDK_POLYFILLS_LOADED ' , 1 );
26+
2527/**
2628 * @see https://github.com/sarciszewski/php-future/blob/master/src/Security.php#L37-L51
2729 */
Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ class FacebookTest extends \PHPUnit_Framework_TestCase
4141 'app_secret ' => 'foo_secret ' ,
4242 ];
4343
44+ public function testLoadPolyfills ()
45+ {
46+ $ this ->assertEquals (true , defined ('FACEBOOK_SDK_POLYFILLS_LOADED ' ));
47+ $ this ->assertEquals (1 , FACEBOOK_SDK_POLYFILLS_LOADED );
48+ }
49+
4450 /**
4551 * @expectedException \Facebook\Exceptions\FacebookSDKException
4652 */
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ public function testCanSendNormalRequest()
9595 $ this ->streamMock
9696 ->shouldReceive ('getResponseHeaders ' )
9797 ->once ()
98- ->andReturn (explode ("\n" , trim ($ this ->fakeRawHeader )));
98+ ->andReturn (explode (PHP_EOL , trim ($ this ->fakeRawHeader )));
9999 $ this ->streamMock
100100 ->shouldReceive ('fileGetContents ' )
101101 ->once ()
You can’t perform that action at this time.
0 commit comments