I am working on bug 42906. For this I want to know about the php files in the test directory.
Divyanshi Kathuria divyanshikathuria27.wordpress.com
hi divyanshi,
your question is not clear to me yet. what would you like to know about the php files in the test directory?
taking a look at https://bugzilla.wikimedia.org/show_bug.cgi?id=42906 and the /core/tests/phpunit/structure/StructureTest.php file, the suggestion is to substitute the array provided to, $testClassRegex =, with a dataProvider see https://phpunit.de/manual/3.7/en/writing-tests-for-phpunit.html#writing-test.... the provider method would return an array listing out all of the filenames of the php files within the /core/tests/phpunit/ directory. here is one possible way of getting those filenames, http://php.net/manual/en/function.scandir.php, but i haven’t had a chance to look closely at the test to see if this would be the best way to achieve what's needed. in any case, i believe this is the general idea antoine is getting at.
with kind regards, dan
On Oct 9, 2014, at 19:06 , Divyanshi Kathuria divyanshikathuria@gmail.com wrote:
I am working on bug 42906. For this I want to know about the php files in the test directory.
Divyanshi Kathuria divyanshikathuria27.wordpress.com _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Thu, Oct 09, 2014 at 09:54:03PM +0200, dan entous wrote: this would be the best way to achieve what's needed. in any case, i believe this is the general idea antoine is getting at.
Thank You so much for your help. I have tried to incorporate data providers according to the changes you mentioned. Here is the file : https://gist.github.com/divyanshikathuria/e5a09b50f65779f92c69 Please see if it is correct and suggest the necessary changes.
On Oct 12, 2014 10:13 AM, "Divyanshi Kathuria" divyanshikathuria@gmail.com wrote:
On Thu, Oct 09, 2014 at 09:54:03PM +0200, dan entous wrote: this would be the best way to achieve what's needed. in any case, i
believe this is the general idea antoine is getting at.
Thank You so much for your help. I have tried to incorporate data
providers according to the changes you mentioned.
Here is the file :
https://gist.github.com/divyanshikathuria/e5a09b50f65779f92c69
Please see if it is correct and suggest the necessary changes.
-- Divyanshi Kathuria divyanshikathuria27.wordpress.com
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
No, that's not quite right (indentation is wrong, the @dataProvider annotation needs to take the name of the function that is the provider not just "Provider"). I suggest you try looking at other code that uses @dataProvider to try to find an example, or read through the section of the PHPUnit docs on data providers.
For this type of review like question, its probably better to ask on the bug instead of the mailing list unless noone is responding on the bug.
--bawolff
On 12-Oct-2014 9:35 PM, "Brian Wolff" bawolff@gmail.com wrote:
@dataProvider annotation needs to take the name of the function that is the provider not just "Provider"). I suggest you try looking at other code that uses @dataProvider to try to find an example, or read through the section of
the
PHPUnit docs on data providers.
Thanks for pointing out the mistakes. :) I ll make the required changes.
Divyanshi Kathuria divyanshikathuria27.wordpress.com
wikitech-l@lists.wikimedia.org