diff options
Diffstat (limited to 'tests/netscape/BookmarkImportTest.php')
-rw-r--r-- | tests/netscape/BookmarkImportTest.php | 15 |
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 | ||
5 | use DateTime; | 5 | use DateTime; |
6 | use PHPUnit\Framework\TestCase; | 6 | use PHPUnit\Framework\TestCase; |
7 | use Psr\Http\Message\UploadedFileInterface; | ||
7 | use Shaarli\Bookmark\Bookmark; | 8 | use Shaarli\Bookmark\Bookmark; |
8 | use Shaarli\Bookmark\BookmarkFileService; | 9 | use Shaarli\Bookmark\BookmarkFileService; |
9 | use Shaarli\Bookmark\BookmarkFilter; | 10 | use Shaarli\Bookmark\BookmarkFilter; |
10 | use Shaarli\Config\ConfigManager; | 11 | use Shaarli\Config\ConfigManager; |
11 | use Shaarli\History; | 12 | use Shaarli\History; |
13 | use 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 | */ |
20 | function file2array($filename) | 22 | function 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 | ||