aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/netscape
diff options
context:
space:
mode:
Diffstat (limited to 'tests/netscape')
-rw-r--r--tests/netscape/BookmarkImportTest.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/netscape/BookmarkImportTest.php b/tests/netscape/BookmarkImportTest.php
index 20b1c6f4..f678e26b 100644
--- a/tests/netscape/BookmarkImportTest.php
+++ b/tests/netscape/BookmarkImportTest.php
@@ -4,27 +4,28 @@ namespace Shaarli\Netscape;
4 4
5use DateTime; 5use DateTime;
6use PHPUnit\Framework\TestCase; 6use PHPUnit\Framework\TestCase;
7use Psr\Http\Message\UploadedFileInterface;
7use Shaarli\Bookmark\Bookmark; 8use Shaarli\Bookmark\Bookmark;
8use Shaarli\Bookmark\BookmarkFileService; 9use Shaarli\Bookmark\BookmarkFileService;
9use Shaarli\Bookmark\BookmarkFilter; 10use Shaarli\Bookmark\BookmarkFilter;
10use Shaarli\Config\ConfigManager; 11use Shaarli\Config\ConfigManager;
11use Shaarli\History; 12use Shaarli\History;
13use Slim\Http\UploadedFile;
12 14
13/** 15/**
14 * Utility function to load a file's metadata in a $_FILES-like array 16 * Utility function to load a file's metadata in a $_FILES-like array
15 * 17 *
16 * @param string $filename Basename of the file 18 * @param string $filename Basename of the file
17 * 19 *
18 * @return array A $_FILES-like array 20 * @return UploadedFileInterface Upload file in PSR-7 compatible object
19 */ 21 */
20function file2array($filename) 22function file2array($filename)
21{ 23{
22 return array( 24 return new UploadedFile(
23 'filetoupload' => array( 25 __DIR__ . '/input/' . $filename,
24 'name' => $filename, 26 $filename,
25 'tmp_name' => __DIR__ . '/input/' . $filename, 27 null,
26 'size' => filesize(__DIR__ . '/input/' . $filename) 28 filesize(__DIR__ . '/input/' . $filename)
27 )
28 ); 29 );
29} 30}
30 31