public function testMultiDepth()
 {
     $this->assertEquals(['main' => ['sub1' => [new UploadedFile('/private/var/abcdefg', 6171, 0, 'sub1_0.png', 'image/png'), new UploadedFile('/private/var/abcdefg', 6172, 0, 'sub1_1.png', 'image/png')], 'sub2' => ['sub1' => new UploadedFile('/private/var/abcdefg', 6173, 0, 'sub2_sub1.png', 'image/png'), 'sub2' => new UploadedFile('/private/var/abcdefg', 6174, 0, 'sub2_sub2.png', 'image/png')]]], UploadedFileFactory::fromFiles(['main' => ['name' => ['sub1' => ['sub1_0.png', 'sub1_1.png'], 'sub2' => ['sub1' => 'sub2_sub1.png', 'sub2' => 'sub2_sub2.png']], 'type' => ['sub1' => ['image/png', 'image/png'], 'sub2' => ['sub1' => 'image/png', 'sub2' => 'image/png']], 'tmp_name' => ['sub1' => ['/private/var/abcdefg', '/private/var/abcdefg'], 'sub2' => ['sub1' => '/private/var/abcdefg', 'sub2' => '/private/var/abcdefg']], 'error' => ['sub1' => [0, 0], 'sub2' => ['sub1' => 0, 'sub2' => 0]], 'size' => ['sub1' => [6171, 6172], 'sub2' => ['sub1' => 6173, 'sub2' => 6174]]]]));
 }
Ejemplo n.º 2
0
 /**
  * @param array $server
  * @param array $get
  * @param array $post
  * @param array $cookies
  * @param array $files
  * @return ServerRequestInterface
  */
 public static function create(array $server, array $get, array $post, array $cookies, array $files)
 {
     return new ServerRequest($server, $cookies, $get, UploadedFileFactory::fromFiles($files), $post, [], '1.1', static::getUri($server));
 }