@@ -19,10 +19,12 @@ class page_operator_get_pages_test extends page_operator_base
19
19
*/
20
20
public function get_pages_test_data ()
21
21
{
22
- return array (
23
- array (
24
- array (
25
- array (
22
+ return [
23
+ [
24
+ 0 ,
25
+ 0 ,
26
+ [
27
+ [
26
28
'page_id ' => 1 ,
27
29
'page_order ' => 1 ,
28
30
'page_description ' => 'description_1 ' ,
@@ -34,8 +36,8 @@ public function get_pages_test_data()
34
36
'page_display_to_guests ' => 1 ,
35
37
'page_title_switch ' => 0 ,
36
38
'page_icon_font ' => 'foo-1 ' ,
37
- ) ,
38
- array (
39
+ ] ,
40
+ [
39
41
'page_id ' => 2 ,
40
42
'page_order ' => 2 ,
41
43
'page_description ' => 'description_2 ' ,
@@ -47,8 +49,8 @@ public function get_pages_test_data()
47
49
'page_display_to_guests ' => 1 ,
48
50
'page_title_switch ' => 0 ,
49
51
'page_icon_font ' => '' ,
50
- ) ,
51
- array (
52
+ ] ,
53
+ [
52
54
'page_id ' => 3 ,
53
55
'page_order ' => 3 ,
54
56
'page_description ' => 'description_3 ' ,
@@ -60,8 +62,8 @@ public function get_pages_test_data()
60
62
'page_display_to_guests ' => 0 ,
61
63
'page_title_switch ' => 0 ,
62
64
'page_icon_font ' => '' ,
63
- ) ,
64
- array (
65
+ ] ,
66
+ [
65
67
'page_id ' => 4 ,
66
68
'page_order ' => 4 ,
67
69
'page_description ' => 'description_4 ' ,
@@ -73,27 +75,46 @@ public function get_pages_test_data()
73
75
'page_display_to_guests ' => 0 ,
74
76
'page_title_switch ' => 0 ,
75
77
'page_icon_font ' => '' ,
76
- ),
77
- ),
78
- ),
79
- );
78
+ ],
79
+ ],
80
+ ],
81
+ [
82
+ 2 ,
83
+ 1 ,
84
+ [
85
+ [
86
+ 'page_id ' => 3 ,
87
+ 'page_order ' => 3 ,
88
+ 'page_description ' => 'description_3 ' ,
89
+ 'page_description_display ' => 0 ,
90
+ 'page_route ' => 'page_3 ' ,
91
+ 'page_title ' => 'title_3 ' ,
92
+ 'page_content ' => 'message_3 ' ,
93
+ 'page_display ' => 1 ,
94
+ 'page_display_to_guests ' => 0 ,
95
+ 'page_title_switch ' => 0 ,
96
+ 'page_icon_font ' => '' ,
97
+ ],
98
+ ],
99
+ ],
100
+ ];
80
101
}
81
102
82
103
/**
83
104
* Test getting pages from the database
84
105
*
85
106
* @dataProvider get_pages_test_data
86
107
*/
87
- public function test_get_pages ($ expected )
108
+ public function test_get_pages ($ start , $ limit , $ expected )
88
109
{
89
- // Setup the operator class
110
+ // Set up the operator class
90
111
$ operator = $ this ->get_page_operator ();
91
112
92
113
// Grab the page data as an array of entities
93
- $ entities = $ operator ->get_pages ();
114
+ $ entities = $ operator ->get_pages ($ limit , $ start );
94
115
95
116
// Map the fields to the getters
96
- $ map = array (
117
+ $ map = [
97
118
'page_id ' => 'get_id ' ,
98
119
'page_order ' => 'get_order ' ,
99
120
'page_description ' => 'get_description ' ,
@@ -105,7 +126,7 @@ public function test_get_pages($expected)
105
126
'page_display_to_guests ' => 'get_page_display_to_guests ' ,
106
127
'page_title_switch ' => 'get_page_title_switch ' ,
107
128
'page_icon_font ' => 'get_icon_font ' ,
108
- ) ;
129
+ ] ;
109
130
110
131
// Test through each entity in the array of entities
111
132
$ i = 0 ;
0 commit comments