forked from ledgersmb/LedgerSMB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path42-admin.pg
54 lines (40 loc) · 1.91 KB
/
42-admin.pg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
BEGIN;
-- Load the TAP functions.
CREATE EXTENSION pgtap;
SET client_min_messages TO warning;
-- Plan the tests.
SELECT plan(25);
-- Add data
\i xt/data/42-pg/Base.sql
-- Validate required tables
SELECT has_table('defaults');
SELECT has_table('entity_employee');
SELECT has_table('session');
SELECT has_table('user_preference');
SELECT has_table('users');
-- Validate required views
SELECT has_view('user_listable');
-- Validate required functions
SELECT has_function('admin__add_user_to_role',ARRAY['text','text']);
SELECT has_function('admin__delete_user',ARRAY['text','boolean']);
SELECT has_function('admin__drop_session',ARRAY['integer']);
SELECT has_function('admin__get_roles','{}'::text[]);
SELECT has_function('admin__get_roles_for_user',ARRAY['integer']);
SELECT has_function('admin__get_roles_for_user_by_entity',ARRAY['integer']);
SELECT has_function('admin__get_user',ARRAY['integer']);
SELECT has_function('admin__get_user_by_entity',ARRAY['integer']);
SELECT has_function('admin__is_user',ARRAY['text']);
SELECT has_function('admin__list_sessions','{}'::text[]);
SELECT has_function('admin__remove_user_from_role',ARRAY['text','text']);
SELECT has_function('admin__save_user',ARRAY['integer','integer','text','text','boolean']);
SELECT has_function('admin__search_users',ARRAY['text','text','text','text','date']);
SELECT has_function('user__change_password',ARRAY['text']);
SELECT has_function('user__check_my_expiration','{}'::text[]);
SELECT has_function('user__get_all_users','{}'::text[]);
SELECT has_function('user__get_preferences',ARRAY['integer']);
SELECT has_function('user__save_preferences',ARRAY['text','text','text','text','text']);
-- Run tests
SELECT ok(true,'No specific admin tests yet!');
-- Finish the tests and clean up.
SELECT * FROM finish();
ROLLBACK;