public function testHeadersHasAndGetWorkProperly() { $headers = new Headers(); $headers->addHeaders(array($f = new Header\GenericHeader('Foo', 'bar'), new Header\GenericHeader('Baz', 'baz'))); $this->assertFalse($headers->has('foobar')); $this->assertTrue($headers->has('foo')); $this->assertTrue($headers->has('Foo')); $this->assertSame($f, $headers->get('foo')); }
public function testRemoveHeaderWithInstanceWillRemoveThatInstance() { $headers = new Mail\Headers(); $headers->addHeaders(array(array('Foo' => 'foo'), array('Foo' => 'bar'), 'Baz' => 'baz')); $header = $headers->get('foo')->current(); $this->assertEquals(3, $headers->count()); $headers->removeHeader($header); $this->assertEquals(2, $headers->count()); $this->assertTrue($headers->has('foo')); $this->assertNotSame($header, $headers->get('foo')); }