Skip to content

Commit 3bb98fa

Browse files
committed
Actually test for having multiple headers with same name.
1 parent 264c840 commit 3bb98fa

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

tests/HTTP/MessageTest.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,21 @@ public function testBodyBasics()
145145
}
146146

147147
//--------------------------------------------------------------------
148-
149-
148+
149+
public function testCanHaveMultipleHeadersWithSameName()
150+
{
151+
$this->message->setHeader('Line', 'foo1');
152+
$this->message->setHeader('Line', 'foo2');
153+
154+
$headers = $this->message->getHeader('line');
155+
156+
$this->assertTrue(is_array($headers));
157+
$this->assertEquals(2, count($headers));
158+
$this->assertTrue($headers[0] instanceof \CodeIgniter\HTTP\Header);
159+
$this->assertTrue($headers[1] instanceof \CodeIgniter\HTTP\Header);
160+
$this->assertEquals('foo1', $headers[0]->getValueLine());
161+
$this->assertEquals('foo2', $headers[1]->getValueLine());
162+
}
163+
164+
//--------------------------------------------------------------------
150165
}

0 commit comments

Comments
 (0)