mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-17 14:24:51 +01:00
Fixing more unit tests
This commit is contained in:
parent
00299e24e8
commit
56bcafb095
tests/Guzzle/Tests/Http/Message
@ -137,8 +137,12 @@ class EntityEnclosingRequestTest extends \Guzzle\Tests\GuzzleTestCase
|
||||
$this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
|
||||
$request = RequestFactory::create('POST', $this->getServer()->getUrl());
|
||||
$request->addPostFiles(array(__FILE__));
|
||||
$request->addPostFields(array(
|
||||
'test' => 'abc'
|
||||
));
|
||||
$this->assertEquals(array(
|
||||
'file' => '@' . __FILE__
|
||||
'file' => '@' . __FILE__,
|
||||
'test' => 'abc'
|
||||
), $request->getPostFields()->getAll());
|
||||
$this->assertEquals(array(
|
||||
'file' => __FILE__
|
||||
@ -146,7 +150,7 @@ class EntityEnclosingRequestTest extends \Guzzle\Tests\GuzzleTestCase
|
||||
$request->send();
|
||||
|
||||
$this->assertNotNull($request->getHeader('Content-Length'));
|
||||
$this->assertContains('multipart/form-data; boundary=--', $request->getHeader('Content-Type'), '-> cURL must add the boundary');
|
||||
$this->assertContains('multipart/form-data; boundary=', $request->getHeader('Content-Type'), '-> cURL must add the boundary');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -83,7 +83,7 @@ class RequestTest extends \Guzzle\Tests\GuzzleTestCase
|
||||
// Add authorization after the fact and see that it was put in the message
|
||||
$this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
|
||||
$request = RequestFactory::put($this->getServer()->getUrl(), null, 'Data');
|
||||
$request->setAuth('michael', '123', 'Basic');
|
||||
$request->setAuth('michael', '123', CURLAUTH_BASIC);
|
||||
$request->send();
|
||||
$str = (string) $request;
|
||||
$this->assertTrue((bool) strpos($str, 'Authorization: Basic ' . $auth));
|
||||
|
Loading…
x
Reference in New Issue
Block a user