Building further on top of the existing Test Cases in the file baidu_analytics.test, there might be a few more things we might want to test from code:
The Baidu Analytics module currently adds three permisions:
- administer baidu analytics
- opt-in or out of tracking
- use PHP for tracking visibility
and there doesn't seem to be any Automated Test Cases yet, to enforce and check whether the permissions work as expected, from code:
Test Cases:
- Display of the PHP tracking visibility option and description text in the admin settings form page, if the permission is granted.
- Access to the Baidu Analytics admin settings form page.
- Different configurations of the Opt-in or out of tracking option and access to the field when permission is enabled/disabled.
Please let me know if you would have any questions, objections, comments, suggestions, recommendations or concerns on any aspects of this feature request, I would be glad to provide more information or explain in more details.
Any questions, feedback, testing, changes, ideas or recommendations would be highly appreciated.
Thanks to all in advance.
Comments
Comment #1
dydave commentedQuick follow-up on this feature request:
Modified the file
baidu_analytics.testto add a new Test Case Class, calledBaiduAnalyticsPermissionsTestwich performs the tests described in the issue summary:With the PHP filter module enabled, display the Baidu Analytics Settings form page and check whether the option to select PHP code for the Page Visibility settings is displayed or hidden, with or without the use PHP for tracking visibility permission.
Revoke the administer baidu analytics permission and ensure access is denied with a
403response code.With the opt-in or out of tracking permission enabled, check the display of the Enable user tracking (opt-in or out) option in the user account edit page, whether it's checked or unchecked by default, according to configuration settings. Then, revoke the permission and ensure the field is not displayed even if it is still configured to appear in module's settings (for example, opt-in or out checked by default).
I went ahead and committed the changes against the 7.x-1.x branch at 19fd70f.
I allowed myself to mark this issue as fixed for now, but feel free to re-open it, or post a new ticket, at any time if you have any further objections with this ticket or related commit 19fd70f (we would surely be happy to hear your feedback).
Please let me know if you would have any further comments, feedback, questions, issues, objections, suggestions or concerns on the commit or this feature request in general, I would be glad to provide more information or explain in more details.
Thanks in advance to everyone for your testing, reviews, feedback and comments on this issue.
Cheers!