diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-09-08 15:33:52 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-18 11:55:15 +0200 |
commit | 5247a0685d52b3889339cc5535b9b2a051ee03f2 (patch) | |
tree | ca3cd380cf70ad462b5f82f2dd36f4207b6b3730 /tests/lib/connector/sabre | |
parent | 8fa4ebaf6dcede56968d4ae387f3542385ca2f0d (diff) | |
download | nextcloud-server-5247a0685d52b3889339cc5535b9b2a051ee03f2.tar.gz nextcloud-server-5247a0685d52b3889339cc5535b9b2a051ee03f2.zip |
clear up tests a bit
Diffstat (limited to 'tests/lib/connector/sabre')
-rw-r--r-- | tests/lib/connector/sabre/requesttest/uploadtest.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/lib/connector/sabre/requesttest/uploadtest.php b/tests/lib/connector/sabre/requesttest/uploadtest.php index b8cd44afda7..8f39aff81b9 100644 --- a/tests/lib/connector/sabre/requesttest/uploadtest.php +++ b/tests/lib/connector/sabre/requesttest/uploadtest.php @@ -8,6 +8,8 @@ namespace Test\Connector\Sabre\RequestTest; +use OC\AppFramework\Http; + class UploadTest extends RequestTest { public function testBasicUpload() { $user = $this->getUniqueID(); @@ -16,7 +18,7 @@ class UploadTest extends RequestTest { $this->assertFalse($view->file_exists('foo.txt')); $response = $this->request($view, $user, 'pass', 'PUT', '/foo.txt', 'asd'); - $this->assertEquals(201, $response->getStatus()); + $this->assertEquals(Http::STATUS_CREATED, $response->getStatus()); $this->assertTrue($view->file_exists('foo.txt')); $this->assertEquals('asd', $view->file_get_contents('foo.txt')); @@ -33,7 +35,7 @@ class UploadTest extends RequestTest { $response = $this->request($view, $user, 'pass', 'PUT', '/foo.txt', 'asd'); - $this->assertEquals(204, $response->getStatus()); + $this->assertEquals(Http::STATUS_NO_CONTENT, $response->getStatus()); $this->assertEquals('asd', $view->file_get_contents('foo.txt')); $info = $view->getFileInfo('foo.txt'); @@ -53,7 +55,7 @@ class UploadTest extends RequestTest { $response = $this->request($view, $user, 'pass', 'PUT', '/foo.txt-chunking-123-2-1', 'bar', ['OC-Chunked' => '1']); - $this->assertEquals(201, $response->getStatus()); + $this->assertEquals(Http::STATUS_CREATED, $response->getStatus()); $this->assertTrue($view->file_exists('foo.txt')); $this->assertEquals('asdbar', $view->file_get_contents('foo.txt')); @@ -70,12 +72,12 @@ class UploadTest extends RequestTest { $view->file_put_contents('foo.txt', 'bar'); $response = $this->request($view, $user, 'pass', 'PUT', '/foo.txt-chunking-123-2-0', 'asd', ['OC-Chunked' => '1']); - $this->assertEquals(201, $response->getStatus()); + $this->assertEquals(Http::STATUS_CREATED, $response->getStatus()); $this->assertEquals('bar', $view->file_get_contents('foo.txt')); $response = $this->request($view, $user, 'pass', 'PUT', '/foo.txt-chunking-123-2-1', 'bar', ['OC-Chunked' => '1']); - $this->assertEquals(201, $response->getStatus()); + $this->assertEquals(Http::STATUS_CREATED, $response->getStatus()); $this->assertEquals('asdbar', $view->file_get_contents('foo.txt')); @@ -91,7 +93,7 @@ class UploadTest extends RequestTest { $this->assertFalse($view->file_exists('foo.txt')); $response = $this->request($view, $user, 'pass', 'PUT', '/foo.txt-chunking-123-2-1', 'bar', ['OC-Chunked' => '1']); - $this->assertEquals(201, $response->getStatus()); + $this->assertEquals(Http::STATUS_CREATED, $response->getStatus()); $this->assertFalse($view->file_exists('foo.txt')); $response = $this->request($view, $user, 'pass', 'PUT', '/foo.txt-chunking-123-2-0', 'asd', ['OC-Chunked' => '1']); |