@@ 30-40 (lines=11) @@ | ||
27 | ||
28 | } |
|
29 | ||
30 | public function testCallback() { |
|
31 | $stream = fopen('data://text/plain,test_data', 'r'); |
|
32 | $this->expectOutputString('test_data'); |
|
33 | ||
34 | $ioutput = $this->getMockBuilder('OCP\AppFramework\Http\IOutput') |
|
35 | ->disableOriginalConstructor() |
|
36 | ->getMock(); |
|
37 | ||
38 | $streamResponse = new StreamResponse($stream); |
|
39 | $streamResponse->callback($ioutput); |
|
40 | } |
|
41 | ||
42 | public function testCallbackRewind() { |
|
43 | $stream = fopen('data://text/plain,test_data', 'r'); |
|
@@ 42-53 (lines=12) @@ | ||
39 | $streamResponse->callback($ioutput); |
|
40 | } |
|
41 | ||
42 | public function testCallbackRewind() { |
|
43 | $stream = fopen('data://text/plain,test_data', 'r'); |
|
44 | fseek($stream, 5); |
|
45 | $this->expectOutputString('test_data'); |
|
46 | ||
47 | $ioutput = $this->getMockBuilder('OCP\AppFramework\Http\IOutput') |
|
48 | ->disableOriginalConstructor() |
|
49 | ->getMock(); |
|
50 | ||
51 | $streamResponse = new StreamResponse($stream); |
|
52 | $streamResponse->callback($ioutput); |
|
53 | } |
|
54 | } |