1
1
<?php
2
2
/**
3
3
* @see https://github.com/zendframework/zend-diactoros for the canonical source repository
4
- * @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
4
+ * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (http://www.zend.com)
5
5
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
6
6
*/
7
7
8
8
namespace ZendTest \Diactoros ;
9
9
10
10
use PHPUnit \Framework \TestCase ;
11
11
use Psr \Http \Message \UploadedFileInterface ;
12
+
12
13
use function Zend \Diactoros \normalizeUploadedFiles ;
13
14
14
15
class NormalizeUploadedFilesTest extends TestCase
15
16
{
16
- public function testFlatFile ()
17
+ public function testCreatesUploadedFileFromFlatFileSpecification ()
17
18
{
18
19
$ files = [
19
20
'avatar ' => [
@@ -32,7 +33,7 @@ public function testFlatFile()
32
33
$ this ->assertEquals ('my-avatar.png ' , $ normalised ['avatar ' ]->getClientFilename ());
33
34
}
34
35
35
- public function testNestedFile ()
36
+ public function testTraversesNestedFileSpecificationToExtractUploadedFile ()
36
37
{
37
38
$ files = [
38
39
'my-form ' => [
@@ -54,7 +55,7 @@ public function testNestedFile()
54
55
$ this ->assertEquals ('my-avatar.png ' , $ normalised ['my-form ' ]['details ' ]['avatar ' ]->getClientFilename ());
55
56
}
56
57
57
- public function testNumericIndexedFiles ()
58
+ public function testTraversesNestedFileSpecificationContainingNumericIndicesToExtractUploadedFiles ()
58
59
{
59
60
$ files = [
60
61
'my-form ' => [
@@ -99,9 +100,10 @@ public function testNumericIndexedFiles()
99
100
}
100
101
101
102
/**
102
- * This case covers upfront numeric index which moves the tmp_name/size/etc fields further up the array tree
103
+ * This case covers upfront numeric index which moves the tmp_name/size/etc
104
+ * fields further up the array tree
103
105
*/
104
- public function testNumericFirstIndexedFiles ()
106
+ public function testTraversesDenormalizedNestedTreeOfIndicesToExtractUploadedFiles ()
105
107
{
106
108
$ files = [
107
109
'slide-shows ' => [
0 commit comments