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") ); } } ?>