Commit Graph
11 Commits
Author SHA1 Message Date
Kent Riboe c376b56029 Add regression tests for global admin TOTP exception privileges (#1015)
* Add regression tests for global admin privilege check in TOTP exceptions (#1012)

Verifies that global admins with both 'admin' and 'global-admin' roles
can add TOTP exceptions for any domain, while regular admins are
restricted to their managed domains.

* Add tests for db_in_clause(): placeholders, empty array, unique keys, real query

Covers the parameterized query refactor from PR #1004.

* Move test cleanup to tearDown: add admin table delete and session unset

Prevents state leaking between tests, especially when expectException()
aborts the method before inline cleanup runs.

* Use assertEquals with exact expected SQL per review
2026-04-15 21:12:01 +01:00
David Goodwin 2d6ded2786 PSR2 -> PSR12 formatting 2022-06-28 13:46:11 +01:00
David Goodwin 2edabc3e03 phpcs insists on some brace changes 2021-04-13 21:19:16 +01:00
David Goodwin 823f27b29d phpcs wants to change ... 2021-03-22 09:28:28 +00:00
David Goodwin 3cd62f9f4f update to phpunit v8, try changing coveralls library, update github action 2020-04-14 21:03:10 +01:00
David Goodwin de5b739d4a drop unnecessary common.php 2019-02-18 21:19:54 +00:00
David Goodwin d95ee79b9a reformat 2019-02-15 21:31:32 +00:00
David Goodwin 803e2342f8 fix psalm issues; reformat; rename new db functions 2019-01-06 21:32:58 +00:00
David Goodwin 1176c9ce78 reformat; fix some transition bugs 2019-01-06 21:32:58 +00:00
David Goodwin ea33d9951a try migrating to pdo 2019-01-06 21:32:58 +00:00
David Goodwin 590c80f0bc add more unit tests; re-enable random_int warning in functions.inc.php for old php versions etc etc 2018-12-29 20:54:25 +00:00