@@ -658,9 +658,13 @@ public static function providerForTestPopulateRequestWithEncryptedQueryParamsWit
658658
659659 public function testGetDownloadHeaders (): void
660660 {
661- $ headersList = Core::getDownloadHeaders ('test.sql ' , 'text/x-sql ' , 100 , false );
661+ $ headersList = Core::getDownloadHeaders ('test.sql ' , 'text/x-sql ' , 100 , ' 2015-10-21T05:28:00-02:00 ' );
662662
663663 $ expected = [
664+ 'Expires ' => 'Wed, 21 Oct 2015 07:28:00 GMT ' ,
665+ 'Cache-Control ' => 'no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0 ' ,
666+ 'Pragma ' => 'no-cache ' ,
667+ 'Last-Modified ' => 'Wed, 21 Oct 2015 07:28:00 GMT ' ,
664668 'Content-Description ' => 'File Transfer ' ,
665669 'Content-Disposition ' => 'attachment; filename="test.sql" ' ,
666670 'Content-Type ' => 'text/x-sql ' ,
@@ -672,9 +676,13 @@ public function testGetDownloadHeaders(): void
672676
673677 public function testGetDownloadHeaders2 (): void
674678 {
675- $ headersList = Core::getDownloadHeaders ('test.sql.gz ' , 'application/x-gzip ' , 0 , false );
679+ $ headersList = Core::getDownloadHeaders ('test.sql.gz ' , 'application/x-gzip ' , 0 , ' 2015-10-21T05:28:00-02:00 ' );
676680
677681 $ expected = [
682+ 'Expires ' => 'Wed, 21 Oct 2015 07:28:00 GMT ' ,
683+ 'Cache-Control ' => 'no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0 ' ,
684+ 'Pragma ' => 'no-cache ' ,
685+ 'Last-Modified ' => 'Wed, 21 Oct 2015 07:28:00 GMT ' ,
678686 'Content-Description ' => 'File Transfer ' ,
679687 'Content-Disposition ' => 'attachment; filename="test.sql.gz" ' ,
680688 'Content-Type ' => 'application/x-gzip ' ,
@@ -702,4 +710,28 @@ public function testGetEnv(): void
702710
703711 self ::assertSame ('' , Core::getEnv ('PHPMYADMIN_GET_ENV_TEST ' ));
704712 }
713+
714+ public function testGetNoCacheHeaders (): void
715+ {
716+ $ expected = [
717+ 'Expires ' => 'Wed, 21 Oct 2015 07:28:00 GMT ' ,
718+ 'Cache-Control ' => 'no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0 ' ,
719+ 'Pragma ' => 'no-cache ' ,
720+ 'Last-Modified ' => 'Wed, 21 Oct 2015 07:28:00 GMT ' ,
721+ ];
722+ self ::assertSame ($ expected , Core::getNoCacheHeaders ('2015-10-21T05:28:00-02:00 ' ));
723+ }
724+
725+ public function testHeaderJSON (): void
726+ {
727+ $ expected = [
728+ 'Expires ' => 'Wed, 21 Oct 2015 07:28:00 GMT ' ,
729+ 'Cache-Control ' => 'no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0 ' ,
730+ 'Pragma ' => 'no-cache ' ,
731+ 'Last-Modified ' => 'Wed, 21 Oct 2015 07:28:00 GMT ' ,
732+ 'Content-Type ' => 'application/json; charset=UTF-8 ' ,
733+ 'X-Content-Type-Options ' => 'nosniff ' ,
734+ ];
735+ self ::assertSame ($ expected , Core::headerJSON ('2015-10-21T05:28:00-02:00 ' ));
736+ }
705737}
0 commit comments