MediaWiki REL1_31
HTTPFileStreamerTest.php
Go to the documentation of this file.
1<?php
2
3use PHPUnit\Framework\TestCase;
4
5class HTTPFileStreamerTest extends TestCase {
6
11 public function testPreprocessHeaders( array $input, array $expectedRaw, array $expectedOpt ) {
12 list( $actualRaw, $actualOpt ) = HTTPFileStreamer::preprocessHeaders( $input );
13 $this->assertSame( $expectedRaw, $actualRaw );
14 $this->assertSame( $expectedOpt, $actualOpt );
15 }
16
17 public function providePreprocessHeaders() {
18 return [
19 [
20 [ 'Vary' => 'cookie', 'Cache-Control' => 'private' ],
21 [ 'Vary: cookie', 'Cache-Control: private' ],
22 [],
23 ],
24 [
25 [
26 'Range' => 'bytes=(123-456)',
27 'Content-Type' => 'video/mp4',
28 'If-Modified-Since' => 'Wed, 21 Oct 2015 07:28:00 GMT',
29 ],
30 [ 'Content-Type: video/mp4' ],
31 [ 'range' => 'bytes=(123-456)', 'if-modified-since' => 'Wed, 21 Oct 2015 07:28:00 GMT' ],
32 ],
33 ];
34 }
35
36}
testPreprocessHeaders(array $input, array $expectedRaw, array $expectedOpt)
HTTPFileStreamer::preprocessHeaders providePreprocessHeaders.
static preprocessHeaders( $headers)
Takes HTTP headers in a name => value format and converts them to the weird format expected by stream...
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition deferred.txt:11
if(is_array($mode)) switch( $mode) $input