Update test coverage.

This commit is contained in:
James Cole
2018-08-25 20:45:42 +02:00
parent 2099da7142
commit c55b80f467
21 changed files with 169 additions and 2 deletions

View File

@@ -144,9 +144,11 @@ class AttachmentHelper implements AttachmentHelperInterface
{
$resource = tmpfile();
if (false === $resource) {
// @codeCoverageIgnoreStart
Log::error('Cannot create temp-file for file upload.');
return false;
// @codeCoverageIgnoreEnd
}
$path = stream_get_meta_data($resource)['uri'];
fwrite($resource, $content);
@@ -341,9 +343,12 @@ class AttachmentHelper implements AttachmentHelperInterface
if (!$this->validMime($file)) {
$result = false;
}
// @codeCoverageIgnoreStart
// can't seem to reach this point.
if (true === $result && !$this->validSize($file)) {
$result = false;
}
// @codeCoverageIgnoreEnd
if (true === $result && $this->hasFile($file, $model)) {
$result = false;
}