Skip to content

Instantly share code, notes, and snippets.

@sangar82
Last active August 29, 2015 14:06
Show Gist options
  • Save sangar82/c514db0c34980602d7e0 to your computer and use it in GitHub Desktop.
Save sangar82/c514db0c34980602d7e0 to your computer and use it in GitHub Desktop.
new UploadedFile
public function testStorePhoto_Ok () {
$path = /* path/to/your/file */;
$filename = /* your/file/name */;
$mimeType = /* your/file/mime/type es: 'image/jpeg' */
$file = new Symfony\Component\HttpFoundation\File\UploadedFile (
$path . $filename,
$filename,
$mimeType
);
$this -> call (
'POST',
'api/photo',
array(/* your/parameters */),
array('photo' => $file)
);
$this -> assertResponseOk();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment