Conversation
897ec00
to
1ae5d36
Compare
will do a test for this |
Hum, in fact, i don't see any way to achieve a fileupload with phpunit. |
As far as I can see in existing code, nothing would prevent to simulate an upload. The only thing that should prevent fake file upload would be use of |
inc/deployfile.class.php
Outdated
|
||
//remove file | ||
unset($files[$index]); | ||
//array_splice($datas['jobs']['associatedFiles'], $index, 1); | ||
unset($datas['associatedFiles'][$sha512]); | ||
//array_splice($data['jobs']['associatedFiles'], $index, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this line could be dropped
inc/deployfile.class.php
Outdated
* @return boolean | ||
*/ | ||
static function removeFileInRepo($sha512, $packages_id) { | ||
static function removeFileInRepo($sha512) { | ||
$repoPath = GLPI_PLUGIN_DOC_DIR."/fusioninventory/files/repository/"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not paths be declared elsewhere? I guess same ones are used on the upload part; it would be better to have only one var to change/adapt for both of them.
http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
@link http://www.fusioninventory.org/ | ||
@link http://forge.fusioninventory.org/projects/fusioninventory-for-glpi/ | ||
@since 2013 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad year :p
------------------------------------------------------------------------ | ||
*/ | ||
|
||
class RepositoryTest extends RestoreDatabase_TestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I've understand well the above code, it is possible to have directories that will be dropped if there is no longer any file into. Maybe add a tests case for that?
* Clean repository on package purge * add tests * unlink file in tests * fix pr comments
No description provided.