You are here

public function ClientTest::testUploadedFileWhenNoFileSelected in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Tests/ClientTest.php \Symfony\Component\HttpKernel\Tests\ClientTest::testUploadedFileWhenNoFileSelected()

File

vendor/symfony/http-kernel/Tests/ClientTest.php, line 129

Class

ClientTest

Namespace

Symfony\Component\HttpKernel\Tests

Code

public function testUploadedFileWhenNoFileSelected() {
  $kernel = new TestHttpKernel();
  $client = new Client($kernel);
  $file = array(
    'tmp_name' => '',
    'name' => '',
    'type' => '',
    'size' => 0,
    'error' => UPLOAD_ERR_NO_FILE,
  );
  $client
    ->request('POST', '/', array(), array(
    'foo' => $file,
  ));
  $files = $client
    ->getRequest()->files
    ->all();
  $this
    ->assertCount(1, $files);
  $this
    ->assertNull($files['foo']);
}