1 | <?php |
||
10 | class Test_Roles extends TestCase { |
||
11 | /** |
||
12 | * Test setup. |
||
13 | */ |
||
14 | public function setUp() { |
||
17 | |||
18 | /** |
||
19 | * Test teardown. |
||
20 | */ |
||
21 | public function tearDown() { |
||
24 | |||
25 | /** |
||
26 | * @covers Automattic\Jetpack\Roles::translate_current_user_to_role |
||
27 | */ |
||
28 | public function test_current_user_to_role_with_role() { |
||
33 | |||
34 | /** |
||
35 | * @covers Automattic\Jetpack\Roles::translate_current_user_to_role |
||
36 | */ |
||
37 | public function test_current_user_to_role_with_capability() { |
||
42 | |||
43 | /** |
||
44 | * @covers Automattic\Jetpack\Roles::translate_current_user_to_role |
||
45 | */ |
||
46 | public function test_current_user_to_role_with_no_match() { |
||
51 | |||
52 | /** |
||
53 | * @covers Automattic\Jetpack\Roles::translate_user_to_role |
||
54 | */ |
||
55 | public function test_user_to_role_with_role() { |
||
61 | |||
62 | /** |
||
63 | * @covers Automattic\Jetpack\Roles::translate_user_to_role |
||
64 | */ |
||
65 | public function test_user_to_role_with_capability() { |
||
71 | |||
72 | /** |
||
73 | * @covers Automattic\Jetpack\Roles::translate_user_to_role |
||
74 | */ |
||
75 | public function test_user_to_role_with_no_match() { |
||
81 | |||
82 | /** |
||
83 | * @covers Automattic\Jetpack\Roles::translate_role_to_cap |
||
84 | */ |
||
85 | public function test_role_to_cap_existing_role() { |
||
88 | |||
89 | /** |
||
90 | * @covers Automattic\Jetpack\Roles::translate_role_to_cap |
||
91 | */ |
||
92 | public function test_role_to_cap_non_existing_role() { |
||
95 | |||
96 | /** |
||
97 | * Mock a global function and make it return a certain value. |
||
98 | * Optionally can limit the mock to invocations with certain arguments. |
||
99 | * |
||
100 | * @param string $function_name Name of the function. |
||
101 | * @param mixed $return_value Return value of the function. |
||
102 | * @param mixed $arg_1_value Value of the first argument value we expect. |
||
103 | * @param mixed $arg_2_value Value of the second argument value we expect. |
||
104 | * @return phpmock\Mock The mock object. |
||
105 | */ |
||
106 | protected function mock_function( $function_name, $return_value = null, $arg_1_value = null, $arg_2_value = null ) { |
||
128 | } |
||
129 |