r81564 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81563‎ | r81564 | r81565 >
Date:16:25, 5 February 2011
Author:hashar
Status:ok (Comments)
Tags:
Comment:
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)
Modified paths:
  • /trunk/phase3/tests/phpunit/MediaWikiTestCase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/MediaWikiTestCase.php
@@ -23,13 +23,8 @@
2424 );
2525
2626 function __construct( $name = null, array $data = array(), $dataName = '' ) {
27 - if ($name !== null) {
28 - $this->setName($name);
29 - }
 27+ parent::__construct( $name, $data, $dataName );
3028
31 - $this->data = $data;
32 - $this->dataName = $dataName;
33 -
3429 $this->backupGlobals = false;
3530 $this->backupStaticAttributes = false;
3631 }

Comments

#Comment by Hashar (talk | contribs)   16:26, 5 February 2011

This patch took me most of the afternoon :( Might want to test it with pre 3.5 PHPUnit release.

Status & tagging log