X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=phpunit%2FMessageBodyTest.php;h=253fb55ccc199ca204a850680507a96d7df1c387;hp=1764ef6027b89128915420ce2667676fbb27ab3c;hb=1bcceb6d155dfed7e352f9559974527787d1ae97;hpb=9886ab46dbb299c9d6cfef9d8a0258d91b90a8e6 diff --git a/phpunit/MessageBodyTest.php b/phpunit/MessageBodyTest.php index 1764ef6..253fb55 100644 --- 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( - array( + (object) array( "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() { - $this->assertEquals(0, $this->file->append("nope")); - $this->assertEquals(3, $this->temp->append("yes")); + $this->temp->append("yes"); } 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( - "file" => __FILE__, - "name" => "upload", - "type" => "text/plain", - ) + "file" => __FILE__, + "name" => "upload", + "type" => "text/plain", ) ) );