@@ -239,7 +239,7 @@ public function testGetWithAlreadyExistingFileAndOutdatedTimestamp() {
239239 $ this ->timeFactory
240240 ->expects ($ this ->at (0 ))
241241 ->method ('getTime ' )
242- ->willReturn (1501 );
242+ ->willReturn (4801 );
243243 $ client = $ this ->createMock (IClient::class);
244244 $ this ->clientService
245245 ->expects ($ this ->once ())
@@ -249,7 +249,15 @@ public function testGetWithAlreadyExistingFileAndOutdatedTimestamp() {
249249 $ client
250250 ->expects ($ this ->once ())
251251 ->method ('get ' )
252- ->with ($ this ->endpoint )
252+ ->with (
253+ $ this ->equalTo ($ this ->endpoint ),
254+ $ this ->equalTo ([
255+ 'timeout ' => 10 ,
256+ 'headers ' => [
257+ 'Accept-Encoding ' => 'gzip ' ,
258+ ]
259+ ])
260+ )
253261 ->willReturn ($ response );
254262 $ response
255263 ->expects ($ this ->once ())
@@ -342,7 +350,15 @@ public function testGetWithAlreadyExistingFileAndNoVersion() {
342350 $ client
343351 ->expects ($ this ->once ())
344352 ->method ('get ' )
345- ->with ($ this ->endpoint )
353+ ->with (
354+ $ this ->equalTo ($ this ->endpoint ),
355+ $ this ->equalTo ([
356+ 'timeout ' => 10 ,
357+ 'headers ' => [
358+ 'Accept-Encoding ' => 'gzip ' ,
359+ ]
360+ ])
361+ )
346362 ->willReturn ($ response );
347363 $ response
348364 ->expects ($ this ->once ())
@@ -430,7 +446,15 @@ public function testGetWithAlreadyExistingFileAndOutdatedVersion() {
430446 $ client
431447 ->expects ($ this ->once ())
432448 ->method ('get ' )
433- ->with ($ this ->endpoint )
449+ ->with (
450+ $ this ->equalTo ($ this ->endpoint ),
451+ $ this ->equalTo ([
452+ 'timeout ' => 10 ,
453+ 'headers ' => [
454+ 'Accept-Encoding ' => 'gzip ' ,
455+ ]
456+ ])
457+ )
434458 ->willReturn ($ response );
435459 $ response
436460 ->expects ($ this ->once ())
@@ -495,7 +519,15 @@ public function testGetWithExceptionInClient() {
495519 $ client
496520 ->expects ($ this ->once ())
497521 ->method ('get ' )
498- ->with ($ this ->endpoint )
522+ ->with (
523+ $ this ->equalTo ($ this ->endpoint ),
524+ $ this ->equalTo ([
525+ 'timeout ' => 10 ,
526+ 'headers ' => [
527+ 'Accept-Encoding ' => 'gzip ' ,
528+ ]
529+ ])
530+ )
499531 ->willThrowException (new \Exception ());
500532
501533 $ this ->assertSame ([], $ this ->fetcher ->get ());
@@ -533,11 +565,11 @@ public function testGetMatchingETag() {
533565 $ this ->timeFactory
534566 ->expects ($ this ->at (0 ))
535567 ->method ('getTime ' )
536- ->willReturn (1501 );
568+ ->willReturn (4801 );
537569 $ this ->timeFactory
538570 ->expects ($ this ->at (1 ))
539571 ->method ('getTime ' )
540- ->willReturn (1502 );
572+ ->willReturn (4802 );
541573 $ client = $ this ->createMock (IClient::class);
542574 $ this ->clientService
543575 ->expects ($ this ->once ())
@@ -552,14 +584,15 @@ public function testGetMatchingETag() {
552584 $ this ->equalTo ([
553585 'timeout ' => 10 ,
554586 'headers ' => [
555- 'If-None-Match ' => '"myETag" '
587+ 'Accept-Encoding ' => 'gzip ' ,
588+ 'If-None-Match ' => '"myETag" ' ,
556589 ]
557590 ])
558591 )->willReturn ($ response );
559592 $ response ->method ('getStatusCode ' )
560593 ->willReturn (304 );
561594
562- $ newData = '{"data":[{"id":"MyNewApp","foo":"foo"},{"id":"bar"}],"timestamp":1502 ,"ncversion":"11.0.0.2","ETag":"\"myETag\""} ' ;
595+ $ newData = '{"data":[{"id":"MyNewApp","foo":"foo"},{"id":"bar"}],"timestamp":4802 ,"ncversion":"11.0.0.2","ETag":"\"myETag\""} ' ;
563596 $ file
564597 ->expects ($ this ->at (1 ))
565598 ->method ('putContent ' )
@@ -624,6 +657,7 @@ public function testGetNoMatchingETag() {
624657 $ this ->equalTo ([
625658 'timeout ' => 10 ,
626659 'headers ' => [
660+ 'Accept-Encoding ' => 'gzip ' ,
627661 'If-None-Match ' => '"myETag" ' ,
628662 ]
629663 ])
@@ -638,7 +672,7 @@ public function testGetNoMatchingETag() {
638672 $ response ->method ('getHeader ' )
639673 ->with ($ this ->equalTo ('ETag ' ))
640674 ->willReturn ('"newETag" ' );
641- $ fileData = '{"data":[{"id":"MyNewApp","foo":"foo"},{"id":"bar"}],"timestamp":1502 ,"ncversion":"11.0.0.2","ETag":"\"newETag\""} ' ;
675+ $ fileData = '{"data":[{"id":"MyNewApp","foo":"foo"},{"id":"bar"}],"timestamp":4802 ,"ncversion":"11.0.0.2","ETag":"\"newETag\""} ' ;
642676 $ file
643677 ->expects ($ this ->at (1 ))
644678 ->method ('putContent ' )
@@ -650,11 +684,11 @@ public function testGetNoMatchingETag() {
650684 $ this ->timeFactory
651685 ->expects ($ this ->at (0 ))
652686 ->method ('getTime ' )
653- ->willReturn (1501 );
687+ ->willReturn (4801 );
654688 $ this ->timeFactory
655689 ->expects ($ this ->at (1 ))
656690 ->method ('getTime ' )
657- ->willReturn (1502 );
691+ ->willReturn (4802 );
658692
659693 $ expected = [
660694 [
@@ -710,6 +744,9 @@ public function testFetchAfterUpgradeNoETag() {
710744 $ this ->equalTo ($ this ->endpoint ),
711745 $ this ->equalTo ([
712746 'timeout ' => 10 ,
747+ 'headers ' => [
748+ 'Accept-Encoding ' => 'gzip ' ,
749+ ],
713750 ])
714751 )
715752 ->willReturn ($ response );
0 commit comments