projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
standard return values; fix tests
[m6w6/ext-http]
/
phpunit
/
MessageBodyTest.php
diff --git
a/phpunit/MessageBodyTest.php
b/phpunit/MessageBodyTest.php
index cc0f421efd9f92c31d2d9d7cd76999773b563a20..253fb55ccc199ca204a850680507a96d7df1c387 100644
(file)
--- a/
phpunit/MessageBodyTest.php
+++ b/
phpunit/MessageBodyTest.php
@@
-14,7
+14,7
@@
class MessageBodyTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(fileatime(__FILE__), $this->file->stat("atime"));
$this->assertEquals(filectime(__FILE__), $this->file->stat("ctime"));
$this->assertEquals(
$this->assertEquals(fileatime(__FILE__), $this->file->stat("atime"));
$this->assertEquals(filectime(__FILE__), $this->file->stat("ctime"));
$this->assertEquals(
- array(
+
(object)
array(
"size" => 0,
"mtime" => 0,
"atime" => 0,
"size" => 0,
"mtime" => 0,
"atime" => 0,
@@
-24,26
+24,27
@@
class MessageBodyTest extends PHPUnit_Framework_TestCase {
);
}
);
}
+ function testAppendError() {
+ $this->setExpectedException("PHPUnit_Framework_Error");
+ $this->file->append("nope");
+ }
function testAppend() {
function testAppend() {
- $this->assertEquals(0, $this->file->append("nope"));
- $this->assertEquals(3, $this->temp->append("yes"));
+ $this->temp->append("yes");
}
function testAddForm() {
}
function testAddForm() {
- $this->assertTrue(
- $this->temp->addForm(
- array(
- "foo" => "bar",
- "more" => array(
- "bah", "baz", "fuz"
- ),
+ $this->temp->addForm(
+ array(
+ "foo" => "bar",
+ "more" => array(
+ "bah", "baz", "fuz"
),
),
+ ),
+ array(
array(
array(
- array(
- "file" => __FILE__,
- "name" => "upload",
- "type" => "text/plain",
- )
+ "file" => __FILE__,
+ "name" => "upload",
+ "type" => "text/plain",
)
)
);
)
)
);
@@
-124,4
+125,11
@@
class MessageBodyTest extends PHPUnit_Framework_TestCase {
function testClone() {
$this->assertEquals((string) $this->file, (string) clone $this->file);
}
function testClone() {
$this->assertEquals((string) $this->file, (string) clone $this->file);
}
+
+ function testGetResource() {
+ $stream = $this->file->getResource();
+ $this->assertTrue(is_resource($stream));
+ $stat = fstat($stream);
+ $this->assertEquals(filesize(__FILE__), $stat["size"]);
+ }
}
}