Skip to content

Commit

Permalink
MDL-33955 filelib: accept any HTTP 1.0 in tests
Browse files Browse the repository at this point in the history
This is common with proxies like squid which don't support http
pipelining.
  • Loading branch information
danpoltawski committed Jun 19, 2013
1 parent 1d4ae19 commit 846f6fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/tests/filelib_test.php
Expand Up @@ -105,7 +105,7 @@ public function test_download_file_content() {
$this->assertInstanceOf('stdClass', $response); $this->assertInstanceOf('stdClass', $response);
$this->assertSame('200', $response->status); $this->assertSame('200', $response->status);
$this->assertTrue(is_array($response->headers)); $this->assertTrue(is_array($response->headers));
$this->assertSame('HTTP/1.1 200 OK', rtrim($response->response_code)); $this->assertRegExp('|^HTTP/1\.[01] 200 OK$|', rtrim($response->response_code));
$this->assertSame($contents, $response->results); $this->assertSame($contents, $response->results);
$this->assertSame('', $response->error); $this->assertSame('', $response->error);


Expand All @@ -131,7 +131,7 @@ public function test_download_file_content() {
$this->assertInstanceOf('stdClass', $response); $this->assertInstanceOf('stdClass', $response);
$this->assertSame('404', $response->status); $this->assertSame('404', $response->status);
$this->assertTrue(is_array($response->headers)); $this->assertTrue(is_array($response->headers));
$this->assertSame('HTTP/1.1 404 Not Found', rtrim($response->response_code)); $this->assertRegExp('|^HTTP/1\.[01] 404 Not Found$|', rtrim($response->response_code));
$this->assertStringStartsWith('<!DOCTYPE', $response->results); $this->assertStringStartsWith('<!DOCTYPE', $response->results);
$this->assertSame('', $response->error); $this->assertSame('', $response->error);


Expand All @@ -153,7 +153,7 @@ public function test_download_file_content() {
$this->assertInstanceOf('stdClass', $response); $this->assertInstanceOf('stdClass', $response);
$this->assertSame('200', $response->status); $this->assertSame('200', $response->status);
$this->assertTrue(is_array($response->headers)); $this->assertTrue(is_array($response->headers));
$this->assertSame('HTTP/1.1 200 OK', rtrim($response->response_code)); $this->assertRegExp('|^HTTP/1\.[01] 200 OK$|', rtrim($response->response_code));
$this->assertSame('done', $response->results); $this->assertSame('done', $response->results);
$this->assertSame('', $response->error); $this->assertSame('', $response->error);


Expand Down

0 comments on commit 846f6fb

Please sign in to comment.