@@ -19,10 +19,12 @@ class page_operator_get_pages_test extends page_operator_base
1919 */
2020 public function get_pages_test_data ()
2121 {
22- return array (
23- array (
24- array (
25- array (
22+ return [
23+ [
24+ 0 ,
25+ 0 ,
26+ [
27+ [
2628 'page_id ' => 1 ,
2729 'page_order ' => 1 ,
2830 'page_description ' => 'description_1 ' ,
@@ -34,8 +36,8 @@ public function get_pages_test_data()
3436 'page_display_to_guests ' => 1 ,
3537 'page_title_switch ' => 0 ,
3638 'page_icon_font ' => 'foo-1 ' ,
37- ) ,
38- array (
39+ ] ,
40+ [
3941 'page_id ' => 2 ,
4042 'page_order ' => 2 ,
4143 'page_description ' => 'description_2 ' ,
@@ -47,8 +49,8 @@ public function get_pages_test_data()
4749 'page_display_to_guests ' => 1 ,
4850 'page_title_switch ' => 0 ,
4951 'page_icon_font ' => '' ,
50- ) ,
51- array (
52+ ] ,
53+ [
5254 'page_id ' => 3 ,
5355 'page_order ' => 3 ,
5456 'page_description ' => 'description_3 ' ,
@@ -60,8 +62,8 @@ public function get_pages_test_data()
6062 'page_display_to_guests ' => 0 ,
6163 'page_title_switch ' => 0 ,
6264 'page_icon_font ' => '' ,
63- ) ,
64- array (
65+ ] ,
66+ [
6567 'page_id ' => 4 ,
6668 'page_order ' => 4 ,
6769 'page_description ' => 'description_4 ' ,
@@ -73,27 +75,46 @@ public function get_pages_test_data()
7375 'page_display_to_guests ' => 0 ,
7476 'page_title_switch ' => 0 ,
7577 '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+ ];
80101 }
81102
82103 /**
83104 * Test getting pages from the database
84105 *
85106 * @dataProvider get_pages_test_data
86107 */
87- public function test_get_pages ($ expected )
108+ public function test_get_pages ($ start , $ limit , $ expected )
88109 {
89- // Setup the operator class
110+ // Set up the operator class
90111 $ operator = $ this ->get_page_operator ();
91112
92113 // Grab the page data as an array of entities
93- $ entities = $ operator ->get_pages ();
114+ $ entities = $ operator ->get_pages ($ limit , $ start );
94115
95116 // Map the fields to the getters
96- $ map = array (
117+ $ map = [
97118 'page_id ' => 'get_id ' ,
98119 'page_order ' => 'get_order ' ,
99120 'page_description ' => 'get_description ' ,
@@ -105,7 +126,7 @@ public function test_get_pages($expected)
105126 'page_display_to_guests ' => 'get_page_display_to_guests ' ,
106127 'page_title_switch ' => 'get_page_title_switch ' ,
107128 'page_icon_font ' => 'get_icon_font ' ,
108- ) ;
129+ ] ;
109130
110131 // Test through each entity in the array of entities
111132 $ i = 0 ;
0 commit comments