From 7ca349f02b85dcb4a5569d21a31c90b34e52ab93 Mon Sep 17 00:00:00 2001 From: uckelman Date: Sun, 9 May 2010 15:21:32 +0000 Subject: Added test. git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6807 67b53d14-2c14-4ace-a08f-0dab2b34000c --- test/HTTP_POST_multipartTest.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/HTTP_POST_multipartTest.php (limited to 'test/HTTP_POST_multipartTest.php') diff --git a/test/HTTP_POST_multipartTest.php b/test/HTTP_POST_multipartTest.php new file mode 100644 index 0000000..373848c --- /dev/null +++ b/test/HTTP_POST_multipartTest.php @@ -0,0 +1,34 @@ +getMethods() as $method) { + $method->setAccessible(true); + } + } + + /** + * @dataProvider providerBuildDataPart + */ + public function testBuildDataPart($name, $data, $expected, $ex) { + if ($ex) $this->setExpectedException($ex); + $poster = new HTTP_POST_multipart(); + $this->assertEquals($expected, $poster->buildDataPart($name, $data)); + } + + public function providerBuildDataPart() { + return array( + array(null, null, 'Exception'), + array('foo', 1, "Content-Disposition: form-data; name=\"foo\"\r\n\r\n1\r\n") + ); + } + +} + +?> -- cgit v1.2.3