You are here

public function ClientTest::testUsesPostFilesUploadError in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/fabpot/goutte/Goutte/Tests/ClientTest.php \Goutte\Tests\ClientTest::testUsesPostFilesUploadError()

File

vendor/fabpot/goutte/Goutte/Tests/ClientTest.php, line 272

Class

ClientTest
Goutte Client Test.

Namespace

Goutte\Tests

Code

public function testUsesPostFilesUploadError() {
  $guzzle = $this
    ->getGuzzle();
  $client = new Client();
  $client
    ->setClient($guzzle);
  $files = array(
    'test' => array(
      'name' => '',
      'type' => '',
      'tmp_name' => '',
      'error' => 4,
      'size' => 0,
    ),
  );
  $client
    ->request('POST', 'http://www.example.com/', array(), $files);
  $request = end($this->history)['request'];
  $stream = $request
    ->getBody();
  $boundary = $stream
    ->getBoundary();
  $this
    ->assertEquals("--{$boundary}--\r\n", $stream
    ->getContents());
}