Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benakamoorthi@fastmail.fm>2014-06-19 06:01:45 +0400
committerdiosmosis <benakamoorthi@fastmail.fm>2014-06-19 06:01:52 +0400
commitf169ee42e8bc15ffa63b5589d16280aa10e88ee1 (patch)
tree758dae3cfd2d94f827756d5db2bbb74ed6016e46 /tests/resources
parent6c1970444bb93e8bb1370f7248682fd7b515b308 (diff)
Add ability to serve only part of a static file. Includes tests for new functionality.
Diffstat (limited to 'tests/resources')
-rw-r--r--tests/resources/staticFileServer.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/resources/staticFileServer.php b/tests/resources/staticFileServer.php
index cdaa54830f..69ed020696 100644
--- a/tests/resources/staticFileServer.php
+++ b/tests/resources/staticFileServer.php
@@ -54,6 +54,11 @@ define("ZLIB_OUTPUT_REQUEST_VAR", "zlibOutput");
define("NULL_FILE_SRV_MODE", "nullFile");
define("GHOST_FILE_SRV_MODE", "ghostFile");
define("TEST_FILE_SRV_MODE", "testFile");
+define("PARTIAL_TEST_FILE_SRV_MODE", "partialTestFile");
+define("WHOLE_TEST_FILE_WITH_RANGE_SRV_MODE", "wholeTestFileWithRange");
+
+define("PARTIAL_BYTE_START", 1204);
+define("PARTIAL_BYTE_END", 14724);
/**
@@ -89,4 +94,14 @@ switch ($staticFileServerMode) {
ProxyHttp::serverStaticFile(TEST_FILE_LOCATION, TEST_FILE_CONTENT_TYPE);
break;
+
+ case PARTIAL_TEST_FILE_SRV_MODE:
+
+ ProxyHttp::serverStaticFile(TEST_FILE_LOCATION, TEST_FILE_CONTENT_TYPE, $expireFarFutureDays = 100, PARTIAL_BYTE_START, PARTIAL_BYTE_END);
+ break;
+
+ case WHOLE_TEST_FILE_WITH_RANGE_SRV_MODE:
+
+ ProxyHttp::serverStaticFile(TEST_FILE_LOCATION, TEST_FILE_CONTENT_TYPE, $expireFarFutureDays = 100, 0, filesize(TEST_FILE_LOCATION));
+ break;
} \ No newline at end of file