$this->assertEquals(3, $this->temp->append("yes"));
}
- function testAdd() {
+ function testAddForm() {
$this->assertTrue(
- $this->temp->add(
+ $this->temp->addForm(
array(
"foo" => "bar",
"more" => array(
"\r\n".
"fuz\r\n".
"--%x.%x\r\n".
- "Content-Disposition: attachment; name=\"upload\"; filename=\"MessageBodyTest.php\"\r\n".
+ "Content-Disposition: form-data; name=\"upload\"; filename=\"MessageBodyTest.php\"\r\n".
"Content-Transfer-Encoding: binary\r\n".
"Content-Type: text/plain\r\n".
"\r\n".
);
}
+ function testAddPart() {
+ $this->temp->addPart(new http\Message("This: is a header\n\nand this is the data\n"));
+ $this->assertStringMatchesFormat(
+ "--%x.%x\r\n".
+ "This: is a header\r\n".
+ "Content-Length: 21\r\n".
+ "\r\n".
+ "and this is the data\n\r\n".
+ "--%x.%x--\r\n".
+ "",
+ str_replace("\r", "", $this->temp)
+ );
+ }
+
function testEtag() {
$s = stat(__FILE__);
$this->assertEquals(
);
$this->assertEquals($s, (string) $this->file);
}
+
+ function testClone() {
+ $this->assertEquals((string) $this->file, (string) clone $this->file);
+ }
}