setExpectedException($ex); $class = new ReflectionClass('HTTP_POST_multipart'); $method = $class->getMethod('buildDataPart'); $method->setAccessible(true); $this->assertEquals( $expected, $method->invokeArgs(null, array($name, $data)) ); } public function providerBuildDataPart() { return array( array(null, null, null, 'Exception'), array('foo', 1, "Content-Disposition: form-data; name=\"foo\"\r\n\r\n1\r\n", null) ); } } ?>