Differences Between: [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]
A collection of tests for accesslib::has_capability().
Copyright: | 2018 Andrew Nicols <andrew@nicols.co.uk> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 701 lines (30 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
accesslib_has_capability_testcase:: (7 methods):
test_locked_contexts()
test_locked_contexts_for_admin_with_config()
locked_context_provider()
login_as_provider()
test_login_as_admin()
test_login_as_user()
get_test_data()
Class: accesslib_has_capability_testcase - X-Ref
Unit tests tests for has_capability.test_locked_contexts($lockedcontexts, $blocked) X-Ref |
Unit tests to check the operation of locked contexts. Note: We only check the admin user here. If the admin cannot do it, then no-one can. param: string[] $lockedcontexts The list of contexts, by name, to mark as locked param: string[] $blocked The list of contexts which will be 'blocked' by has_capability |
test_locked_contexts_for_admin_with_config($lockedcontexts, $blocked) X-Ref |
Unit tests to check the operation of locked contexts. Note: We only check the admin user here. If the admin cannot do it, then no-one can. param: string[] $lockedcontexts The list of contexts, by name, to mark as locked param: string[] $blocked The list of contexts which will be 'blocked' by has_capability |
locked_context_provider() X-Ref |
Data provider for testing that has_capability() deals with locked contexts. return: array |
login_as_provider() X-Ref |
Data provider for for has_capability tests when logged in as a different user. return: array |
test_login_as_admin(string $loginascontext, array $testcontexts) X-Ref |
Test that the log in as functionality works as expected for an administrator. An administrator logged in as another user assumes all of their capabilities. param: string $loginascontext param: string $testcontexts |
test_login_as_user(string $loginascontext, array $testcontexts) X-Ref |
Test that the log in as functionality works as expected for a regulr user. param: string $loginascontext param: string $testcontexts |
get_test_data() X-Ref |
Get the test data contexts. return: stdClass |