/**
  * @depends testCreateProtocol
  * @param Protocol $protocol
  * @return ProtocolFile
  */
 public function testUpload(Protocol $protocol)
 {
     $response = $this->queryUpload($protocol->getId(), true);
     $result = $this->assertJsonResponse($response, Response::HTTP_OK, true, true);
     $this->assertNotEmpty($result);
     $this->assertEquals(1, count($result));
     $result = $result[0];
     $this->assertStringEndsWith($result->filename, get_class());
     $this->assertNotEmpty($result->mime_type);
     $this->assertNotEmpty($result->length);
     $this->assertEquals($protocol->getId(), $result->protocol->id);
     return $this->dm->getRepository('FormBundle:ProtocolFile')->find($result->id);
 }