Skip to content
Permalink
Browse files

Cover objects in constructor case.

  • Loading branch information...
markstory committed Sep 5, 2016
1 parent 7222b45 commit 4fc0c093b0bd37efb9b2cd493b537f5e5e01f3ff
Showing with 19 additions and 0 deletions.
  1. +19 −0 tests/TestCase/Network/RequestTest.php
@@ -528,6 +528,25 @@ public function testFilesZeroithIndex()
$this->assertEquals($files[0]['name'], $uploads[0]->getClientFilename());
}
/**
* Test that the constructor uses uploaded file objects
* if they are present. This could happen in test scenarios.
*
* @return void
*/
public function testFilesObject()
{
$file = new UploadedFile(
__FILE__,
123,
UPLOAD_ERR_OK,
'test.php',
'text/plain'
);
$request = new Request(['files' => ['avatar' => $file]]);
$this->assertSame(['avatar' => $file], $request->getUploadedFiles());
}
/**
* Test replacing files.
*

0 comments on commit 4fc0c09

Please sign in to comment.
You can’t perform that action at this time.