Пример #1
0
 public function testMethod_PUTandGET()
 {
     unset($_SERVER['HTTP_X_EXPECTED_ENTITY_LENGTH']);
     $_SERVER['CONTENT_LENGTH'] = strlen(self::STREAM_CONTENT);
     $this->setCurrentUser('/system/users/jane');
     \DAV::$CHUNK_SIZE = 7;
     $oldEtag = $this->obj->user_prop_getetag();
     $this->obj->method_PUT(self::createInputStream());
     $this->assertNotSame($oldEtag, $this->obj->user_prop_getetag());
     $this->assertSame(self::STREAM_CONTENT, \stream_get_contents($this->obj->method_GET()));
     $this->assertSame(\strlen(self::STREAM_CONTENT), $this->obj->user_prop_getcontentlength());
     // I am not testing content-type as I feel I am too much testing PHP
     // internals to determine the content-type of a file. Especially because
     // below are seperate tests to see if I can set the file type.
 }