From: Antoine Musso Date: Sat, 5 Feb 2011 16:25:18 +0000 (+0000) Subject: Fix @dataProvider with PHPUnit 3.5.8+ X-Git-Tag: 1.31.0-rc.0~32187 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=ba4a69e0e2101e4d25ff01ba303fc9632d7b6fec;p=lhc%2Fweb%2Fwiklou.git Fix @dataProvider with PHPUnit 3.5.8+ MediaWikiTestCase duplicates code from PHPUnit constructor. It worked fine until PHPUnit 3.5.8 made FrameWork_TestCase attributes private, thus the children class is no more able to update them ($data for example) The change break any tests making use of the @dataProvider helper. PHPUnit commit: https://github.com/sebastianbergmann/phpunit/commit/0b85d08c39ce689bc7320ebc03e7e5a4bfdbcbac TESTS: 3.5.7 : OK -> OK 3.5.8 : KO -> OK 3.5.10 : KO -> OK make databaseless Tests: 486, Assertions: 73986, Incomplete: 1, Skipped: 3. (skipped tests are SQLite related) --- diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 48b6212aa7..da02fe7c62 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -23,13 +23,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { ); function __construct( $name = null, array $data = array(), $dataName = '' ) { - if ($name !== null) { - $this->setName($name); - } + parent::__construct( $name, $data, $dataName ); - $this->data = $data; - $this->dataName = $dataName; - $this->backupGlobals = false; $this->backupStaticAttributes = false; }