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 32
32
throw new Exception ('The Facebook SDK requires PHP version 5.4 or higher. ' );
33
33
}
34
34
35
+ if (defined ('FACEBOOK_SDK_POLYFILLS_LOADED ' ) === false ) {
36
+ require_once __DIR__ . 'polyfills.php ' ;
37
+ }
38
+
35
39
/**
36
40
* Register the autoloader for the Facebook SDK classes.
37
41
*
Original file line number Diff line number Diff line change 22
22
*
23
23
*/
24
24
25
+ define ('FACEBOOK_SDK_POLYFILLS_LOADED ' , 1 );
26
+
25
27
/**
26
28
* @see https://github.com/sarciszewski/php-future/blob/master/src/Security.php#L37-L51
27
29
*/
Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ class FacebookTest extends \PHPUnit_Framework_TestCase
41
41
'app_secret ' => 'foo_secret ' ,
42
42
];
43
43
44
+ public function testLoadPolyfills ()
45
+ {
46
+ $ this ->assertEquals (true , defined ('FACEBOOK_SDK_POLYFILLS_LOADED ' ));
47
+ $ this ->assertEquals (1 , FACEBOOK_SDK_POLYFILLS_LOADED );
48
+ }
49
+
44
50
/**
45
51
* @expectedException \Facebook\Exceptions\FacebookSDKException
46
52
*/
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ public function testCanSendNormalRequest()
95
95
$ this ->streamMock
96
96
->shouldReceive ('getResponseHeaders ' )
97
97
->once ()
98
- ->andReturn (explode ("\n" , trim ($ this ->fakeRawHeader )));
98
+ ->andReturn (explode (PHP_EOL , trim ($ this ->fakeRawHeader )));
99
99
$ this ->streamMock
100
100
->shouldReceive ('fileGetContents ' )
101
101
->once ()
You can’t perform that action at this time.
0 commit comments