diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/HTTP_POST_multipartTest.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/HTTP_POST_multipartTest.php b/test/HTTP_POST_multipartTest.php index b2f675b..a6dcae0 100644 --- a/test/HTTP_POST_multipartTest.php +++ b/test/HTTP_POST_multipartTest.php @@ -5,19 +5,22 @@ require_once('src/HTTP_POST_multipart.php'); class HTTP_POST_multipartTest extends PHPUnit_Framework_TestCase { + protected static function getMethod($name) { + $class = new ReflectionClass('HTTP_POST_multipart'); + $method = $class->getMethod($name); + $method->setAccessible(true); + return $method; + } + /** * @dataProvider providerBuildDataPart */ public function testBuildDataPart($name, $data, $expected, $ex) { if ($ex) $this->setExpectedException($ex); - $class = new ReflectionClass('HTTP_POST_multipart'); - $method = $class->getMethod('buildDataPart'); - $method->setAccessible(true); - $this->assertEquals( $expected, - $method->invokeArgs(null, array($name, $data)) + self::getMethod('buildDataPart')->invokeArgs(null, array($name, $data)) ); } @@ -28,6 +31,7 @@ class HTTP_POST_multipartTest extends PHPUnit_Framework_TestCase { ); } + } ?> |