@@ -844,9 +844,7 @@ public function testUploadLocalDetectMime()
844
844
);
845
845
}
846
846
847
- $ file = dirname (realpath (__FILE__ ))
848
- . DIRECTORY_SEPARATOR . '_files '
849
- . DIRECTORY_SEPARATOR . 'staticFile.jpg ' ;
847
+ $ file = __DIR__ . '/_files/staticFile.jpg ' ;
850
848
851
849
$ this ->client ->setUri ($ this ->baseuri . 'testUploads.php ' );
852
850
$ this ->client ->setFileUpload ($ file , 'uploadfile ' );
@@ -884,7 +882,7 @@ public function testStaticLargeFileDownload()
884
882
$ this ->client ->setUri ($ this ->baseuri . 'staticFile.jpg ' );
885
883
886
884
$ got = $ this ->client ->send ()->getBody ();
887
- $ expected = $ this ->_getTestFileContents ('staticFile.jpg ' );
885
+ $ expected = $ this ->getTestFileContents ('staticFile.jpg ' );
888
886
889
887
$ this ->assertEquals ($ expected , $ got , 'Downloaded file does not seem to match! ' );
890
888
}
@@ -934,7 +932,7 @@ public function testZF4238FalseLinesInResponse()
934
932
$ this ->client ->setUri ($ this ->baseuri . 'ZF4238-zerolineresponse.txt ' );
935
933
936
934
$ got = $ this ->client ->send ()->getBody ();
937
- $ expected = $ this ->_getTestFileContents ('ZF4238-zerolineresponse.txt ' );
935
+ $ expected = $ this ->getTestFileContents ('ZF4238-zerolineresponse.txt ' );
938
936
$ this ->assertEquals ($ expected , $ got );
939
937
}
940
938
@@ -957,7 +955,7 @@ public function testStreamResponse()
957
955
$ streamRead = stream_get_contents ($ response ->getStream ());
958
956
$ fileRead = file_get_contents ($ streamName );
959
957
960
- $ expected = $ this ->_getTestFileContents ('staticFile.jpg ' );
958
+ $ expected = $ this ->getTestFileContents ('staticFile.jpg ' );
961
959
962
960
$ this ->assertEquals ($ expected , $ streamRead , 'Downloaded stream does not seem to match! ' );
963
961
$ this ->assertEquals ($ expected , $ fileRead , 'Downloaded file does not seem to match! ' );
@@ -981,7 +979,7 @@ public function testStreamResponseBody()
981
979
982
980
$ body = $ response ->getBody ();
983
981
984
- $ expected = $ this ->_getTestFileContents ('staticFile.jpg ' );
982
+ $ expected = $ this ->getTestFileContents ('staticFile.jpg ' );
985
983
$ this ->assertEquals ($ expected , $ body , 'Downloaded stream does not seem to match! ' );
986
984
}
987
985
@@ -1005,7 +1003,7 @@ public function testStreamResponseNamed()
1005
1003
$ streamRead = stream_get_contents ($ response ->getStream ());
1006
1004
$ fileRead = file_get_contents ($ outfile );
1007
1005
1008
- $ expected = $ this ->_getTestFileContents ('staticFile.jpg ' );
1006
+ $ expected = $ this ->getTestFileContents ('staticFile.jpg ' );
1009
1007
1010
1008
$ this ->assertEquals ($ expected , $ streamRead , 'Downloaded stream does not seem to match! ' );
1011
1009
$ this ->assertEquals ($ expected , $ fileRead , 'Downloaded file does not seem to match! ' );
@@ -1017,17 +1015,12 @@ public function testStreamRequest()
1017
1015
$ this ->markTestSkipped ('Current adapter does not support streaming ' );
1018
1016
return ;
1019
1017
}
1020
- $ data = fopen (
1021
- dirname (realpath (__FILE__ ))
1022
- . DIRECTORY_SEPARATOR . '_files '
1023
- . DIRECTORY_SEPARATOR . 'staticFile.jpg ' ,
1024
- 'r '
1025
- );
1018
+ $ data = fopen (__DIR__ . '/_files/staticFile.jpg ' , 'r ' );
1026
1019
$ this ->client ->setRawBody ($ data );
1027
1020
$ this ->client ->setEncType ('image/jpeg ' );
1028
1021
$ this ->client ->setMethod ('PUT ' );
1029
1022
$ res = $ this ->client ->send ();
1030
- $ expected = $ this ->_getTestFileContents ('staticFile.jpg ' );
1023
+ $ expected = $ this ->getTestFileContents ('staticFile.jpg ' );
1031
1024
$ this ->assertEquals ($ expected , $ res ->getBody (), 'Response body does not contain the expected data ' );
1032
1025
}
1033
1026
@@ -1039,11 +1032,7 @@ public function testStreamRequest()
1039
1032
public function testZF9404DoubleContentLengthHeader ()
1040
1033
{
1041
1034
$ this ->client ->setUri ($ this ->baseuri . 'ZF9404-doubleContentLength.php ' );
1042
- $ expect = filesize (
1043
- dirname (realpath (__FILE__ ))
1044
- . DIRECTORY_SEPARATOR . '_files '
1045
- . DIRECTORY_SEPARATOR . 'ZF9404-doubleContentLength.php '
1046
- );
1035
+ $ expect = filesize (__DIR__ . '/_files/ZF9404-doubleContentLength.php ' );
1047
1036
1048
1037
$ response = $ this ->client ->send ();
1049
1038
if (! $ response ->isSuccess ()) {
@@ -1107,15 +1096,9 @@ public function testUsesProvidedArgSeparator()
1107
1096
* @param string $file
1108
1097
* @return string
1109
1098
*/
1110
- // @codingStandardsIgnoreStart
1111
- protected function _getTestFileContents ($ file )
1099
+ private function getTestFileContents ($ file )
1112
1100
{
1113
- // @codingStandardsIgnoreEnd
1114
- return file_get_contents (
1115
- dirname (realpath (__FILE__ ))
1116
- . DIRECTORY_SEPARATOR . '_files '
1117
- . DIRECTORY_SEPARATOR . $ file
1118
- );
1101
+ return file_get_contents (__DIR__ . '/_files/ ' . $ file );
1119
1102
}
1120
1103
1121
1104
/**
0 commit comments