/** * @group FileService */ public function testResponseHeadersMatchFileAttributesForAttachmentUrls() { $file = new \Elgg\FileService\File(); $file->setFile($this->file); $file->setDisposition('attachment'); $file->bindSession(true); $request = $this->createRequest($file); $response = $this->handler->getResponse($request); $this->assertEquals('text/plain', $response->headers->get('Content-Type')); $filesize = filesize($this->file->getFilenameOnFilestore()); $this->assertEquals($filesize, $response->headers->get('Content-Length')); $this->assertContains('attachment', $response->headers->get('Content-Disposition')); $this->assertEquals('"' . filemtime($this->file->getFilenameOnFilestore()) . '"', $response->headers->get('Etag')); }