Last modified: 2014-10-19 05:50:44 UTC
StructureTest::testUnitTestFileNamesEndWithTest() should be rewritten to use a dataProvider that will give out an array of PHP files under the test directory.
Where is the related file? I would like to work on this. Divyanshi Kathuria
It is in mediawiki/core.git in tests/phpunit/structure/StructureTest.php $ git grep testUnitTestFileNamesEndWithTest tests/phpunit/structure/StructureTest.php: public function testUnitTestFileNamesEndWithTest() { tests/phpunit/structure/StructureTest.php: * Filter to remove testUnitTestFileNamesEndWithTest false positives. The tests in that files can be run using: php tests/phpunit/phpunit.php tests/phpunit/structure/StructureTest.php
(In reply to Antoine "hashar" Musso from comment #2) > It is in mediawiki/core.git in tests/phpunit/structure/StructureTest.php > > > $ git grep testUnitTestFileNamesEndWithTest > tests/phpunit/structure/StructureTest.php: public function > testUnitTestFileNamesEndWithTest() { > tests/phpunit/structure/StructureTest.php: * Filter to remove > testUnitTestFileNamesEndWithTest false positives. > > The tests in that files can be run using: > > php tests/phpunit/phpunit.php tests/phpunit/structure/StructureTest.php What all php files of the test directory do I need to include in the array?
(In reply to Antoine "hashar" Musso (WMF) from comment #2) > It is in mediawiki/core.git in tests/phpunit/structure/StructureTest.php > > > $ git grep testUnitTestFileNamesEndWithTest > tests/phpunit/structure/StructureTest.php: public function > testUnitTestFileNamesEndWithTest() { > tests/phpunit/structure/StructureTest.php: * Filter to remove > testUnitTestFileNamesEndWithTest false positives. > > The tests in that files can be run using: > > php tests/phpunit/phpunit.php tests/phpunit/structure/StructureTest.php I tried to make some changes. Here are the changes : https://gist.github.com/divyanshikathuria/e5a09b50f65779f92c69 Please see if it is correct and suggest me any necessary changes.
divyanshi, have you ever made any commits to the wikimedia code review site, https://gerrit.wikimedia.org? if so, it’s best to commit your changes there, making sure you add a mention of the bug in the commit message, Bug: 42906, and then ask for code review. if you don’t have experience committing to the wikimedia code review site, you can follow the instructions here, http://www.mediawiki.org/wiki/Gerrit, to get started. you’d make your changes against the wikimedia core by first checking out the https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/core project and working from there on a branch you create. also remember that you can run the test locally to make sure all it is running as expected; from the /core directory, you’d run: php tests/phpunit/phpunit.php tests/phpunit/structure/StructureTest.php
https://www.mediawiki.org/wiki/How_to_become_a_MediaWiki_hacker might also be helpful.