-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qual: Fix/complete/refactor ModuleTest case. #28373
Conversation
# Fix: Correct CommonClassTest's constructor Dataproviders did not work because of the issue with the constructor
# Qual: Refactor module name list, add mapping to class name Based on ModuleTest and search for modules in the code, complete the list of modules and map to the class names. This will allow reuse in the ModuleTest.
# Qual: Refactor ModulesInit test Use the updated common module mapping list, more complete than the original list. Also refactor the test to use a data provider.
5d90855
to
e41d058
Compare
# Fix: valid module test must now use array_key_exists Because of the introduction of null key values, isset on the array no longer works, using array_key_exists to test if the modulename is valid.
# Qual: Less verbosity for tests The verbosity on setup/teardown/... is not really usefull and makes the log less readable. Reducing the verbosity while allowing to set an environment variable PHPUNIT_DEBUG to enable it.
'ReceiptPrinter','Reception','Recruitment','Resource', | ||
'Salaries','Service','SocialNetworks','Societe','Stock','Stripe','SupplierProposal','Syslog', | ||
'TakePos','Tax','Ticket','User','Variants','WebServices','WebServicesClient','Website','Workflow','Workstation','Zapier'); | ||
foreach ($modulelist as $modlabel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand where is the foreach after the change ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the "dataProvider" feature from PHPunit.
moduleInitListProvider()
provides the arguments to pass on to the test function - phpunit loops over that list of lists of arguments and executes the test as an independent test.
Fix: Correct CommonClassTest's constructor
Dataproviders did not work because of the issue with the constructor
Qual: Refactor module name list, add mapping to class name
Based on ModuleTest and search for modules in the code, complete the
list of modules and map to the class names.
This will allow reuse in the ModuleTest.
Qual: Refactor ModulesInit test
Use the updated common module mapping list, more complete than
the original list.
Also refactor the test to use a data provider.
Note
Module list needs review/completion.