From 36439693db5a5220cf18bf9b9ad8cc83db17b59e Mon Sep 17 00:00:00 2001 From: uckelman Date: Sun, 9 May 2010 15:50:55 +0000 Subject: Refactored. git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6817 67b53d14-2c14-4ace-a08f-0dab2b34000c --- test/HTTP_POST_multipartTest.php | 14 +++++++++----- 1 file 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 { ); } + } ?> -- cgit v1.2.3