1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30:
<?php
namespace Guzzle\Tests\Http\Message\Header;
use Guzzle\Http\Message\Header\HeaderFactory;
class HeaderFactoryTest extends \Guzzle\Tests\GuzzleTestCase
{
public function testCreatesBasicHeaders()
{
$f = new HeaderFactory();
$h = $f->createHeader('Foo', 'Bar');
$this->assertInstanceOf('Guzzle\Http\Message\Header', $h);
$this->assertEquals('Foo', $h->getName());
$this->assertEquals('Bar', (string) $h);
}
public function testCreatesSpecificHeaders()
{
$f = new HeaderFactory();
$h = $f->createHeader('Link', '<http>; rel="test"');
$this->assertInstanceOf('Guzzle\Http\Message\Header\Link', $h);
$this->assertEquals('Link', $h->getName());
$this->assertEquals('<http>; rel="test"', (string) $h);
}
}