Passed
Pull Request — master (#234)
by Kiran
13:23
created
tests/test-GeoDirectory.php 4 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -956,6 +956,9 @@  discard block
 block discarded – undo
956 956
         flush_rewrite_rules( true );
957 957
     }
958 958
 
959
+    /**
960
+     * @param string $widget
961
+     */
959 962
     function the_widget_form( $widget, $instance = array() ) {
960 963
         global $wp_widget_factory;
961 964
 
@@ -968,6 +971,9 @@  discard block
 block discarded – undo
968 971
         $widget_obj->form($instance);
969 972
     }
970 973
 
974
+    /**
975
+     * @param string $widget
976
+     */
971 977
     function the_widget_form_update( $widget, $new_instance = array(), $old_instance = array() ) {
972 978
         global $wp_widget_factory;
973 979
 
Please login to merge, or discard this patch.
Indentation   +967 added lines, -967 removed lines patch added patch discarded remove patch
@@ -1,989 +1,989 @@
 block discarded – undo
1 1
 <?php
2 2
 class GeoDirectoryTests extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        wp_set_current_user(1);
8
-
9
-        geodir_register_sidebar();
10
-    }
11
-
12
-    public function testBreadcrumbs() {
13
-        $query_args = array(
14
-            'post_status' => 'publish',
15
-            'post_type' => 'gd_place',
16
-            'posts_per_page' => 1,
17
-        );
18
-
19
-        $all_posts = new WP_Query( $query_args );
20
-        $post_id = null;
21
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
22
-            $post_id = get_the_ID();
23
-        endwhile;
24
-
25
-        $this->assertTrue(is_int($post_id));
26
-
27
-        $this->go_to( get_permalink($post_id) );
28
-
29
-        ob_start();
30
-        geodir_breadcrumb();
31
-        $output = ob_get_contents();
32
-        ob_end_clean();
33
-        $this->assertContains('Places', $output);
34
-    }
35
-
36
-    public function testAdminSettingForms() {
37
-        $_REQUEST['listing_type'] = 'gd_place';
38
-        ob_start();
39
-        geodir_admin_option_form('general_settings');
40
-        $output = ob_get_contents();
41
-        ob_end_clean();
42
-        $this->assertContains('General Options', $output);
43
-
44
-        ob_start();
45
-        geodir_admin_option_form('design_settings');
46
-        $output = ob_get_contents();
47
-        ob_end_clean();
48
-        $this->assertContains('Home Top Section Settings', $output);
49
-
50
-        ob_start();
51
-        geodir_admin_option_form('permalink_settings');
52
-        $output = ob_get_contents();
53
-        ob_end_clean();
54
-        $this->assertContains('Listing Detail Permalink Settings', $output);
55
-
56
-        ob_start();
57
-        geodir_admin_option_form('title_meta_settings');
58
-        $output = ob_get_contents();
59
-        ob_end_clean();
60
-        $this->assertContains('Homepage Meta Settings', $output);
61
-
62
-        ob_start();
63
-        geodir_admin_option_form('notifications_settings');
64
-        $output = ob_get_contents();
65
-        ob_end_clean();
66
-        $this->assertContains('Notification Options', $output);
67
-
68
-        ob_start();
69
-        geodir_admin_option_form('default_location_settings');
70
-        $output = ob_get_contents();
71
-        ob_end_clean();
72
-        $this->assertContains('Set Default Location', $output);
73
-
74
-        ob_start();
75
-        geodir_admin_option_form('tools_settings');
76
-        $output = ob_get_contents();
77
-        ob_end_clean();
78
-        $this->assertContains('GD Diagnostic Tools', $output);
79
-
80
-        ob_start();
81
-        geodir_admin_option_form('compatibility_settings');
82
-        $output = ob_get_contents();
83
-        ob_end_clean();
84
-        $this->assertContains('Theme Compatability Settings', $output);
85
-
86
-        ob_start();
87
-        geodir_admin_option_form('import_export');
88
-        $output = ob_get_contents();
89
-        ob_end_clean();
90
-        $this->assertContains('GD Import & Export CSV', $output);
91
-
92
-        $_REQUEST['subtab'] = 'custom_fields';
93
-        ob_start();
94
-        geodir_admin_option_form('gd_place_fields_settings');
95
-        $output = ob_get_contents();
96
-        ob_end_clean();
97
-        $this->assertContains('general-form-builder-frame', $output);
98
-
99
-    }
100
-
101
-    public function testPopPostWidget() {
102
-        $args = array(
103
-            'before_widget' => '<ul>',
104
-            'after_widget' => '<ul>',
105
-            'before_title' => '<ul>',
106
-            'after_title' => '<ul>'
107
-        );
108
-        ob_start();
109
-        geodir_popular_post_category_output($args);
110
-        $output = ob_get_contents();
111
-        ob_end_clean();
112
-        $this->assertContains('Popular Categories', $output);
113
-    }
114
-
115
-    public function texstBestOfWidget() {
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(1);
8
+
9
+		geodir_register_sidebar();
10
+	}
11
+
12
+	public function testBreadcrumbs() {
13
+		$query_args = array(
14
+			'post_status' => 'publish',
15
+			'post_type' => 'gd_place',
16
+			'posts_per_page' => 1,
17
+		);
18
+
19
+		$all_posts = new WP_Query( $query_args );
20
+		$post_id = null;
21
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
22
+			$post_id = get_the_ID();
23
+		endwhile;
24
+
25
+		$this->assertTrue(is_int($post_id));
26
+
27
+		$this->go_to( get_permalink($post_id) );
28
+
29
+		ob_start();
30
+		geodir_breadcrumb();
31
+		$output = ob_get_contents();
32
+		ob_end_clean();
33
+		$this->assertContains('Places', $output);
34
+	}
35
+
36
+	public function testAdminSettingForms() {
37
+		$_REQUEST['listing_type'] = 'gd_place';
38
+		ob_start();
39
+		geodir_admin_option_form('general_settings');
40
+		$output = ob_get_contents();
41
+		ob_end_clean();
42
+		$this->assertContains('General Options', $output);
43
+
44
+		ob_start();
45
+		geodir_admin_option_form('design_settings');
46
+		$output = ob_get_contents();
47
+		ob_end_clean();
48
+		$this->assertContains('Home Top Section Settings', $output);
49
+
50
+		ob_start();
51
+		geodir_admin_option_form('permalink_settings');
52
+		$output = ob_get_contents();
53
+		ob_end_clean();
54
+		$this->assertContains('Listing Detail Permalink Settings', $output);
55
+
56
+		ob_start();
57
+		geodir_admin_option_form('title_meta_settings');
58
+		$output = ob_get_contents();
59
+		ob_end_clean();
60
+		$this->assertContains('Homepage Meta Settings', $output);
61
+
62
+		ob_start();
63
+		geodir_admin_option_form('notifications_settings');
64
+		$output = ob_get_contents();
65
+		ob_end_clean();
66
+		$this->assertContains('Notification Options', $output);
67
+
68
+		ob_start();
69
+		geodir_admin_option_form('default_location_settings');
70
+		$output = ob_get_contents();
71
+		ob_end_clean();
72
+		$this->assertContains('Set Default Location', $output);
73
+
74
+		ob_start();
75
+		geodir_admin_option_form('tools_settings');
76
+		$output = ob_get_contents();
77
+		ob_end_clean();
78
+		$this->assertContains('GD Diagnostic Tools', $output);
79
+
80
+		ob_start();
81
+		geodir_admin_option_form('compatibility_settings');
82
+		$output = ob_get_contents();
83
+		ob_end_clean();
84
+		$this->assertContains('Theme Compatability Settings', $output);
85
+
86
+		ob_start();
87
+		geodir_admin_option_form('import_export');
88
+		$output = ob_get_contents();
89
+		ob_end_clean();
90
+		$this->assertContains('GD Import & Export CSV', $output);
91
+
92
+		$_REQUEST['subtab'] = 'custom_fields';
93
+		ob_start();
94
+		geodir_admin_option_form('gd_place_fields_settings');
95
+		$output = ob_get_contents();
96
+		ob_end_clean();
97
+		$this->assertContains('general-form-builder-frame', $output);
98
+
99
+	}
100
+
101
+	public function testPopPostWidget() {
102
+		$args = array(
103
+			'before_widget' => '<ul>',
104
+			'after_widget' => '<ul>',
105
+			'before_title' => '<ul>',
106
+			'after_title' => '<ul>'
107
+		);
108
+		ob_start();
109
+		geodir_popular_post_category_output($args);
110
+		$output = ob_get_contents();
111
+		ob_end_clean();
112
+		$this->assertContains('Popular Categories', $output);
113
+	}
114
+
115
+	public function texstBestOfWidget() {
116 116
 //        $args = array(
117 117
 //            'before_widget' => '<ul>',
118 118
 //            'after_widget' => '<ul>',
119 119
 //            'before_title' => '<ul>',
120 120
 //            'after_title' => '<ul>'
121 121
 //        );
122
-        include_once geodir_plugin_path() . "/geodirectory-widgets/geodirectory_cpt_categories_widget.php";
123
-        $params = array(
124
-            'title' => '',
125
-            'post_type' => array(), // NULL for all
126
-            'hide_empty' => '',
127
-            'show_count' => '',
128
-            'hide_icon' => '',
129
-            'cpt_left' => '',
130
-            'sort_by' => 'count',
131
-            'max_count' => 'all',
132
-            'max_level' => '1'
133
-        );
134
-        ob_start();
135
-        geodir_cpt_categories_output($params);
136
-        $output = ob_get_contents();
137
-        ob_end_clean();
138
-        $this->assertContains('gd-cptcat-title', $output);
139
-    }
140
-
141
-    public function testGDWisgetListView() {
142
-        global $gridview_columns_widget, $geodir_is_widget_listing;
143
-
144
-        $_REQUEST['sgeo_lat'] = '40.7127837';
145
-        $_REQUEST['sgeo_lon'] = '-74.00594130000002';
146
-        $query_args = array(
147
-            'posts_per_page' => 1,
148
-            'is_geodir_loop' => true,
149
-            'gd_location' => false,
150
-            'post_type' => 'gd_place',
151
-        );
152
-        $widget_listings = geodir_get_widget_listings($query_args);
153
-        $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
154
-        global $post, $map_jason, $map_canvas_arr;
155
-
156
-        $current_post = $post;
157
-        $current_map_jason = $map_jason;
158
-        $current_map_canvas_arr = $map_canvas_arr;
159
-        $geodir_is_widget_listing = true;
160
-
161
-        ob_start();
162
-        include($template);
163
-        $output = ob_get_contents();
164
-        ob_end_clean();
165
-        $this->assertContains('geodir-entry-content', $output);
166
-
167
-        $geodir_is_widget_listing = false;
168
-
169
-        $GLOBALS['post'] = $current_post;
170
-        if (!empty($current_post))
171
-            setup_postdata($current_post);
172
-        $map_jason = $current_map_jason;
173
-        $map_canvas_arr = $current_map_canvas_arr;
174
-
175
-    }
176
-
177
-    public function testRegTemplate() {
122
+		include_once geodir_plugin_path() . "/geodirectory-widgets/geodirectory_cpt_categories_widget.php";
123
+		$params = array(
124
+			'title' => '',
125
+			'post_type' => array(), // NULL for all
126
+			'hide_empty' => '',
127
+			'show_count' => '',
128
+			'hide_icon' => '',
129
+			'cpt_left' => '',
130
+			'sort_by' => 'count',
131
+			'max_count' => 'all',
132
+			'max_level' => '1'
133
+		);
134
+		ob_start();
135
+		geodir_cpt_categories_output($params);
136
+		$output = ob_get_contents();
137
+		ob_end_clean();
138
+		$this->assertContains('gd-cptcat-title', $output);
139
+	}
140
+
141
+	public function testGDWisgetListView() {
142
+		global $gridview_columns_widget, $geodir_is_widget_listing;
143
+
144
+		$_REQUEST['sgeo_lat'] = '40.7127837';
145
+		$_REQUEST['sgeo_lon'] = '-74.00594130000002';
146
+		$query_args = array(
147
+			'posts_per_page' => 1,
148
+			'is_geodir_loop' => true,
149
+			'gd_location' => false,
150
+			'post_type' => 'gd_place',
151
+		);
152
+		$widget_listings = geodir_get_widget_listings($query_args);
153
+		$template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
154
+		global $post, $map_jason, $map_canvas_arr;
155
+
156
+		$current_post = $post;
157
+		$current_map_jason = $map_jason;
158
+		$current_map_canvas_arr = $map_canvas_arr;
159
+		$geodir_is_widget_listing = true;
160
+
161
+		ob_start();
162
+		include($template);
163
+		$output = ob_get_contents();
164
+		ob_end_clean();
165
+		$this->assertContains('geodir-entry-content', $output);
166
+
167
+		$geodir_is_widget_listing = false;
168
+
169
+		$GLOBALS['post'] = $current_post;
170
+		if (!empty($current_post))
171
+			setup_postdata($current_post);
172
+		$map_jason = $current_map_jason;
173
+		$map_canvas_arr = $current_map_canvas_arr;
174
+
175
+	}
176
+
177
+	public function testRegTemplate() {
178 178
 //        var_dump(geodir_login_page_id());
179
-        wp_set_current_user(0);
180
-        $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php';
181
-
182
-        ob_start();
183
-        include($template);
184
-        $output = ob_get_contents();
185
-        ob_end_clean();
186
-        $this->assertContains('Sign In', $output);
187
-    }
188
-
189
-    public function testTemplates() {
190
-
191
-        global $current_user;
192
-
193
-        $user_id = $current_user->ID;
194
-
195
-        $this->setPermalinkStructure();
196
-
197
-        $homepage = get_page_by_title( 'GD Home page' );
198
-        if ( $homepage )
199
-        {
200
-            update_option( 'page_on_front', $homepage->ID );
201
-            update_option( 'show_on_front', 'page' );
202
-        }
203
-
204
-        ob_start();
205
-        $this->go_to( home_url('/') );
206
-        $this->load_template();
207
-        $output = ob_get_contents();
208
-        ob_end_clean();
209
-        $this->assertContains('body class="home', $output);
210
-
211
-
212
-        ob_start();
213
-        $this->go_to( home_url('/?post_type=gd_place') );
214
-        $this->load_template();
215
-        $output = ob_get_contents();
216
-        ob_end_clean();
217
-        $this->assertContains('All Places', $output);
218
-
219
-        ob_start();
220
-        $this->go_to( home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon=') );
221
-        $this->load_template();
222
-        $output = ob_get_contents();
223
-        ob_end_clean();
224
-        $this->assertContains('Search Results for', $output);
225
-
226
-        $query_args = array(
227
-            'post_status' => 'publish',
228
-            'post_type' => 'gd_place',
229
-            'posts_per_page' => 1,
230
-        );
231
-
232
-        $all_posts = new WP_Query( $query_args );
233
-        $post_id = null;
234
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
235
-            $post_id = get_the_ID();
236
-        endwhile;
237
-
238
-        $this->assertTrue(is_int($post_id));
239
-
240
-        global $preview;
241
-        $preview = false;
242
-        ob_start();
243
-        $this->go_to( get_permalink($post_id) );
244
-        $this->load_template();
245
-        $output = ob_get_contents();
246
-        ob_end_clean();
247
-        $this->assertContains('post_profileTab', $output);
248
-
249
-        ob_start();
250
-        $_REQUEST['stype'] = 'gd_place';
251
-        $_REQUEST['geodir_dashbord'] = true;
252
-        $this->go_to( get_author_posts_url($user_id) );
253
-        $this->load_template();
254
-        $output = ob_get_contents();
255
-        ob_end_clean();
256
-        $this->assertContains('gd_list_view', $output);
257
-
258
-    }
259
-
260
-    public function testNavMenus() {
261
-        $menuname = 'Primary Menu';
262
-        $menulocation = 'primary';
263
-        // Does the menu exist already?
264
-        $menu_exists = wp_get_nav_menu_object( $menuname );
265
-
266
-        // If it doesn't exist, let's create it.
267
-        if( !$menu_exists){
268
-            $menu_id = wp_create_nav_menu($menuname);
269
-
270
-            // Set up default BuddyPress links and add them to the menu.
271
-            wp_update_nav_menu_item($menu_id, 0, array(
272
-                'menu-item-title' =>  __('Home'),
273
-                'menu-item-classes' => 'home',
274
-                'menu-item-url' => home_url( '/' ),
275
-                'menu-item-status' => 'publish'));
276
-
277
-            if( !has_nav_menu( $menulocation ) ){
278
-                $locations = get_theme_mod('nav_menu_locations');
279
-                $locations[$menulocation] = $menu_id;
280
-                set_theme_mod( 'nav_menu_locations', $locations );
281
-            }
282
-
283
-            update_option('geodir_theme_location_nav', array('primary'));
284
-
285
-            $menu = wp_nav_menu(array(
286
-                'theme_location' => 'primary',
287
-                'echo' => false,
288
-            ));
289
-
290
-            $this->assertContains('Add Listing', $menu);
291
-
292
-
293
-        }
294
-    }
295
-
296
-    public function testBestOfWidget() {
297
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php';
298
-        include_once($template);
299
-
300
-        ob_start();
301
-        $instance = array();
302
-        $instance['use_viewing_post_type'] = '1';
303
-        $instance['excerpt_type'] = 'show-reviews';
304
-        the_widget( 'geodir_bestof_widget' );
305
-        $output = ob_get_contents();
306
-        ob_end_clean();
307
-        $this->assertContains('bestof-widget-tab-layout', $output);
308
-
309
-        ob_start();
310
-        $this->the_widget_form( 'geodir_bestof_widget' );
311
-        $output = ob_get_contents();
312
-        ob_end_clean();
313
-        $this->assertContains('Number of categories', $output);
314
-
315
-        $new_instance = array(
316
-            'title' => '',
317
-            'post_type' => '',
318
-            'post_limit' => '5',
319
-            'categ_limit' => '3',
320
-            'character_count' => '20',
321
-            'add_location_filter' => '1',
322
-            'tab_layout' => 'bestof-tabs-on-top',
323
-            'excerpt_type' => 'show-desc',
324
-            'use_viewing_post_type' => '1'
325
-        );
326
-        $output = $this->the_widget_form_update( 'geodir_bestof_widget', $new_instance );
327
-        $this->assertContains('20', $output['character_count']);
328
-
329
-        ob_start();
330
-        geodir_bestof_js();
331
-        $output = ob_get_contents();
332
-        ob_end_clean();
333
-        $this->assertContains('bestof-widget-tab-layout', $output);
334
-
335
-    }
336
-
337
-    public function testCptCatsWidget() {
338
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_cpt_categories_widget.php';
339
-        include_once($template);
340
-
341
-        ob_start();
342
-        the_widget( 'geodir_cpt_categories_widget' );
343
-        $output = ob_get_contents();
344
-        ob_end_clean();
345
-        $this->assertContains('geodir_cpt_categories_widget', $output);
346
-
347
-        ob_start();
348
-        $this->the_widget_form( 'geodir_cpt_categories_widget' );
349
-        $output = ob_get_contents();
350
-        ob_end_clean();
351
-        $this->assertContains('Select CPT', $output);
352
-
353
-        $new_instance = array(
354
-            'title' => '',
355
-            'post_type' => array(), // NULL for all
356
-            'hide_empty' => '',
357
-            'show_count' => '',
358
-            'hide_icon' => '',
359
-            'cpt_left' => '',
360
-            'sort_by' => 'count',
361
-            'max_count' => 'all',
362
-            'max_level' => '1'
363
-        );
364
-        $output = $this->the_widget_form_update( 'geodir_cpt_categories_widget', $new_instance );
365
-        $this->assertContains('count', $output['sort_by']);
366
-
367
-    }
368
-
369
-    public function testFeaturesWidget() {
370
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_features_widget.php';
371
-        include_once($template);
372
-
373
-        $instance = array(
374
-            'title' => 'Features',
375
-            'icon_color' => '',
376
-            'title1' => 'Hello World',
377
-            'image1' => 'fa-recycle',
378
-            'desc1' => 'cool',
379
-        );
380
-
381
-        ob_start();
382
-        the_widget( 'Geodir_Features_Widget', $instance);
383
-        $output = ob_get_contents();
384
-        ob_end_clean();
385
-        $this->assertContains('widget_gd_features', $output);
386
-
387
-        ob_start();
388
-        $this->the_widget_form( 'Geodir_Features_Widget', $instance );
389
-        $output = ob_get_contents();
390
-        ob_end_clean();
391
-        $this->assertContains('Font Awesome Icon Color', $output);
392
-
393
-        $new_instance = array(
394
-            'title' => 'Features',
395
-            'icon_color' => '',
396
-            'title1' => 'Hello World',
397
-            'image1' => 'fa-recycle',
398
-            'desc1' => 'cool',
399
-        );
400
-        $output = $this->the_widget_form_update( 'Geodir_Features_Widget', $new_instance );
401
-        $this->assertContains('Features', $output['title']);
402
-
403
-    }
404
-
405
-    public function testSliderWidget() {
406
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_listing_slider_widget.php';
407
-        include_once($template);
408
-
409
-        ob_start();
410
-        the_widget( 'geodir_listing_slider_widget' );
411
-        $output = ob_get_contents();
412
-        ob_end_clean();
413
-        $this->assertContains('geodir_listing_slider_view', $output);
414
-
415
-        ob_start();
416
-        $this->the_widget_form( 'geodir_listing_slider_widget' );
417
-        $output = ob_get_contents();
418
-        ob_end_clean();
419
-        $this->assertContains('Slide Show Speed', $output);
420
-
421
-        $new_instance = array(
422
-            'title' => '',
423
-            'post_type' => '',
424
-            'category' => '',
425
-            'post_number' => '5',
426
-            'max_show' => '1',
427
-            'slide_width' => '',
428
-            'show_title' => '',
429
-            'slideshow' => '',
430
-            'animationLoop' => '',
431
-            'directionNav' => '',
432
-            'slideshowSpeed' => 5000,
433
-            'animationSpeed' => 600,
434
-            'animation' => '',
435
-            'list_sort' => 'latest',
436
-            'show_featured_only' => '',
437
-        );
438
-        $output = $this->the_widget_form_update( 'geodir_listing_slider_widget', $new_instance );
439
-        $this->assertContains('latest', $output['list_sort']);
440
-
441
-    }
442
-
443
-    public function testPopularWidget() {
444
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_popular_widget.php';
445
-        include_once($template);
446
-
447
-        ob_start();
448
-        the_widget( 'geodir_popular_post_category' );
449
-        $output = ob_get_contents();
450
-        ob_end_clean();
451
-        $this->assertContains('geodir_popular_post_category', $output);
452
-
453
-        ob_start();
454
-        $this->the_widget_form( 'geodir_popular_post_category' );
455
-        $output = ob_get_contents();
456
-        ob_end_clean();
457
-        $this->assertContains('Default post type to use', $output);
458
-
459
-        $new_instance = array(
460
-            'title' => '',
461
-            'category_limit' => 15,
462
-            'default_post_type' => ''
463
-        );
464
-        $output = $this->the_widget_form_update( 'geodir_popular_post_category', $new_instance );
465
-        $this->assertEquals(15, $output['category_limit']);
466
-
467
-        ob_start();
468
-        $instance = array();
469
-        $instance['category_title'] = '';
470
-        the_widget( 'geodir_popular_postview', $instance );
471
-        $output = ob_get_contents();
472
-        ob_end_clean();
473
-        $this->assertContains('geodir_popular_post_view', $output);
474
-
475
-        ob_start();
476
-        $this->the_widget_form( 'geodir_popular_postview' );
477
-        $output = ob_get_contents();
478
-        ob_end_clean();
479
-        $this->assertContains('Post Category', $output);
480
-
481
-        $new_instance = array(
482
-            'title' => '',
483
-            'post_type' => '',
484
-            'category' => array(),
485
-            'category_title' => '',
486
-            'list_sort' => '',
487
-            'list_order' => '',
488
-            'post_number' => '5',
489
-            'layout' => 'gridview_onehalf',
490
-            'listing_width' => '',
491
-            'add_location_filter' => '1',
492
-            'character_count' => '20',
493
-            'show_featured_only' => '',
494
-            'show_special_only' => '',
495
-            'with_pics_only' => '',
496
-            'with_videos_only' => '',
497
-            'use_viewing_post_type' => ''
498
-        );
499
-        $output = $this->the_widget_form_update( 'geodir_popular_postview', $new_instance );
500
-        $this->assertContains('gridview_onehalf', $output['layout']);
501
-
502
-    }
503
-
504
-    public function testRelatedWidget() {
505
-        $query_args = array(
506
-            'post_status' => 'publish',
507
-            'post_type' => 'gd_place',
508
-            'posts_per_page' => 1,
509
-        );
510
-
511
-        $all_posts = new WP_Query( $query_args );
512
-        $post_id = null;
513
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
514
-            global $post;
515
-            $post_id = get_the_ID();
516
-            $post = geodir_get_post_info($post->ID);
179
+		wp_set_current_user(0);
180
+		$template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php';
181
+
182
+		ob_start();
183
+		include($template);
184
+		$output = ob_get_contents();
185
+		ob_end_clean();
186
+		$this->assertContains('Sign In', $output);
187
+	}
188
+
189
+	public function testTemplates() {
190
+
191
+		global $current_user;
192
+
193
+		$user_id = $current_user->ID;
194
+
195
+		$this->setPermalinkStructure();
196
+
197
+		$homepage = get_page_by_title( 'GD Home page' );
198
+		if ( $homepage )
199
+		{
200
+			update_option( 'page_on_front', $homepage->ID );
201
+			update_option( 'show_on_front', 'page' );
202
+		}
203
+
204
+		ob_start();
205
+		$this->go_to( home_url('/') );
206
+		$this->load_template();
207
+		$output = ob_get_contents();
208
+		ob_end_clean();
209
+		$this->assertContains('body class="home', $output);
210
+
211
+
212
+		ob_start();
213
+		$this->go_to( home_url('/?post_type=gd_place') );
214
+		$this->load_template();
215
+		$output = ob_get_contents();
216
+		ob_end_clean();
217
+		$this->assertContains('All Places', $output);
218
+
219
+		ob_start();
220
+		$this->go_to( home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon=') );
221
+		$this->load_template();
222
+		$output = ob_get_contents();
223
+		ob_end_clean();
224
+		$this->assertContains('Search Results for', $output);
225
+
226
+		$query_args = array(
227
+			'post_status' => 'publish',
228
+			'post_type' => 'gd_place',
229
+			'posts_per_page' => 1,
230
+		);
231
+
232
+		$all_posts = new WP_Query( $query_args );
233
+		$post_id = null;
234
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
235
+			$post_id = get_the_ID();
236
+		endwhile;
237
+
238
+		$this->assertTrue(is_int($post_id));
239
+
240
+		global $preview;
241
+		$preview = false;
242
+		ob_start();
243
+		$this->go_to( get_permalink($post_id) );
244
+		$this->load_template();
245
+		$output = ob_get_contents();
246
+		ob_end_clean();
247
+		$this->assertContains('post_profileTab', $output);
248
+
249
+		ob_start();
250
+		$_REQUEST['stype'] = 'gd_place';
251
+		$_REQUEST['geodir_dashbord'] = true;
252
+		$this->go_to( get_author_posts_url($user_id) );
253
+		$this->load_template();
254
+		$output = ob_get_contents();
255
+		ob_end_clean();
256
+		$this->assertContains('gd_list_view', $output);
257
+
258
+	}
259
+
260
+	public function testNavMenus() {
261
+		$menuname = 'Primary Menu';
262
+		$menulocation = 'primary';
263
+		// Does the menu exist already?
264
+		$menu_exists = wp_get_nav_menu_object( $menuname );
265
+
266
+		// If it doesn't exist, let's create it.
267
+		if( !$menu_exists){
268
+			$menu_id = wp_create_nav_menu($menuname);
269
+
270
+			// Set up default BuddyPress links and add them to the menu.
271
+			wp_update_nav_menu_item($menu_id, 0, array(
272
+				'menu-item-title' =>  __('Home'),
273
+				'menu-item-classes' => 'home',
274
+				'menu-item-url' => home_url( '/' ),
275
+				'menu-item-status' => 'publish'));
276
+
277
+			if( !has_nav_menu( $menulocation ) ){
278
+				$locations = get_theme_mod('nav_menu_locations');
279
+				$locations[$menulocation] = $menu_id;
280
+				set_theme_mod( 'nav_menu_locations', $locations );
281
+			}
282
+
283
+			update_option('geodir_theme_location_nav', array('primary'));
284
+
285
+			$menu = wp_nav_menu(array(
286
+				'theme_location' => 'primary',
287
+				'echo' => false,
288
+			));
289
+
290
+			$this->assertContains('Add Listing', $menu);
291
+
292
+
293
+		}
294
+	}
295
+
296
+	public function testBestOfWidget() {
297
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php';
298
+		include_once($template);
299
+
300
+		ob_start();
301
+		$instance = array();
302
+		$instance['use_viewing_post_type'] = '1';
303
+		$instance['excerpt_type'] = 'show-reviews';
304
+		the_widget( 'geodir_bestof_widget' );
305
+		$output = ob_get_contents();
306
+		ob_end_clean();
307
+		$this->assertContains('bestof-widget-tab-layout', $output);
308
+
309
+		ob_start();
310
+		$this->the_widget_form( 'geodir_bestof_widget' );
311
+		$output = ob_get_contents();
312
+		ob_end_clean();
313
+		$this->assertContains('Number of categories', $output);
314
+
315
+		$new_instance = array(
316
+			'title' => '',
317
+			'post_type' => '',
318
+			'post_limit' => '5',
319
+			'categ_limit' => '3',
320
+			'character_count' => '20',
321
+			'add_location_filter' => '1',
322
+			'tab_layout' => 'bestof-tabs-on-top',
323
+			'excerpt_type' => 'show-desc',
324
+			'use_viewing_post_type' => '1'
325
+		);
326
+		$output = $this->the_widget_form_update( 'geodir_bestof_widget', $new_instance );
327
+		$this->assertContains('20', $output['character_count']);
328
+
329
+		ob_start();
330
+		geodir_bestof_js();
331
+		$output = ob_get_contents();
332
+		ob_end_clean();
333
+		$this->assertContains('bestof-widget-tab-layout', $output);
334
+
335
+	}
336
+
337
+	public function testCptCatsWidget() {
338
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_cpt_categories_widget.php';
339
+		include_once($template);
340
+
341
+		ob_start();
342
+		the_widget( 'geodir_cpt_categories_widget' );
343
+		$output = ob_get_contents();
344
+		ob_end_clean();
345
+		$this->assertContains('geodir_cpt_categories_widget', $output);
346
+
347
+		ob_start();
348
+		$this->the_widget_form( 'geodir_cpt_categories_widget' );
349
+		$output = ob_get_contents();
350
+		ob_end_clean();
351
+		$this->assertContains('Select CPT', $output);
352
+
353
+		$new_instance = array(
354
+			'title' => '',
355
+			'post_type' => array(), // NULL for all
356
+			'hide_empty' => '',
357
+			'show_count' => '',
358
+			'hide_icon' => '',
359
+			'cpt_left' => '',
360
+			'sort_by' => 'count',
361
+			'max_count' => 'all',
362
+			'max_level' => '1'
363
+		);
364
+		$output = $this->the_widget_form_update( 'geodir_cpt_categories_widget', $new_instance );
365
+		$this->assertContains('count', $output['sort_by']);
366
+
367
+	}
368
+
369
+	public function testFeaturesWidget() {
370
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_features_widget.php';
371
+		include_once($template);
372
+
373
+		$instance = array(
374
+			'title' => 'Features',
375
+			'icon_color' => '',
376
+			'title1' => 'Hello World',
377
+			'image1' => 'fa-recycle',
378
+			'desc1' => 'cool',
379
+		);
380
+
381
+		ob_start();
382
+		the_widget( 'Geodir_Features_Widget', $instance);
383
+		$output = ob_get_contents();
384
+		ob_end_clean();
385
+		$this->assertContains('widget_gd_features', $output);
386
+
387
+		ob_start();
388
+		$this->the_widget_form( 'Geodir_Features_Widget', $instance );
389
+		$output = ob_get_contents();
390
+		ob_end_clean();
391
+		$this->assertContains('Font Awesome Icon Color', $output);
392
+
393
+		$new_instance = array(
394
+			'title' => 'Features',
395
+			'icon_color' => '',
396
+			'title1' => 'Hello World',
397
+			'image1' => 'fa-recycle',
398
+			'desc1' => 'cool',
399
+		);
400
+		$output = $this->the_widget_form_update( 'Geodir_Features_Widget', $new_instance );
401
+		$this->assertContains('Features', $output['title']);
402
+
403
+	}
404
+
405
+	public function testSliderWidget() {
406
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_listing_slider_widget.php';
407
+		include_once($template);
408
+
409
+		ob_start();
410
+		the_widget( 'geodir_listing_slider_widget' );
411
+		$output = ob_get_contents();
412
+		ob_end_clean();
413
+		$this->assertContains('geodir_listing_slider_view', $output);
414
+
415
+		ob_start();
416
+		$this->the_widget_form( 'geodir_listing_slider_widget' );
417
+		$output = ob_get_contents();
418
+		ob_end_clean();
419
+		$this->assertContains('Slide Show Speed', $output);
420
+
421
+		$new_instance = array(
422
+			'title' => '',
423
+			'post_type' => '',
424
+			'category' => '',
425
+			'post_number' => '5',
426
+			'max_show' => '1',
427
+			'slide_width' => '',
428
+			'show_title' => '',
429
+			'slideshow' => '',
430
+			'animationLoop' => '',
431
+			'directionNav' => '',
432
+			'slideshowSpeed' => 5000,
433
+			'animationSpeed' => 600,
434
+			'animation' => '',
435
+			'list_sort' => 'latest',
436
+			'show_featured_only' => '',
437
+		);
438
+		$output = $this->the_widget_form_update( 'geodir_listing_slider_widget', $new_instance );
439
+		$this->assertContains('latest', $output['list_sort']);
440
+
441
+	}
442
+
443
+	public function testPopularWidget() {
444
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_popular_widget.php';
445
+		include_once($template);
446
+
447
+		ob_start();
448
+		the_widget( 'geodir_popular_post_category' );
449
+		$output = ob_get_contents();
450
+		ob_end_clean();
451
+		$this->assertContains('geodir_popular_post_category', $output);
452
+
453
+		ob_start();
454
+		$this->the_widget_form( 'geodir_popular_post_category' );
455
+		$output = ob_get_contents();
456
+		ob_end_clean();
457
+		$this->assertContains('Default post type to use', $output);
458
+
459
+		$new_instance = array(
460
+			'title' => '',
461
+			'category_limit' => 15,
462
+			'default_post_type' => ''
463
+		);
464
+		$output = $this->the_widget_form_update( 'geodir_popular_post_category', $new_instance );
465
+		$this->assertEquals(15, $output['category_limit']);
466
+
467
+		ob_start();
468
+		$instance = array();
469
+		$instance['category_title'] = '';
470
+		the_widget( 'geodir_popular_postview', $instance );
471
+		$output = ob_get_contents();
472
+		ob_end_clean();
473
+		$this->assertContains('geodir_popular_post_view', $output);
474
+
475
+		ob_start();
476
+		$this->the_widget_form( 'geodir_popular_postview' );
477
+		$output = ob_get_contents();
478
+		ob_end_clean();
479
+		$this->assertContains('Post Category', $output);
480
+
481
+		$new_instance = array(
482
+			'title' => '',
483
+			'post_type' => '',
484
+			'category' => array(),
485
+			'category_title' => '',
486
+			'list_sort' => '',
487
+			'list_order' => '',
488
+			'post_number' => '5',
489
+			'layout' => 'gridview_onehalf',
490
+			'listing_width' => '',
491
+			'add_location_filter' => '1',
492
+			'character_count' => '20',
493
+			'show_featured_only' => '',
494
+			'show_special_only' => '',
495
+			'with_pics_only' => '',
496
+			'with_videos_only' => '',
497
+			'use_viewing_post_type' => ''
498
+		);
499
+		$output = $this->the_widget_form_update( 'geodir_popular_postview', $new_instance );
500
+		$this->assertContains('gridview_onehalf', $output['layout']);
501
+
502
+	}
503
+
504
+	public function testRelatedWidget() {
505
+		$query_args = array(
506
+			'post_status' => 'publish',
507
+			'post_type' => 'gd_place',
508
+			'posts_per_page' => 1,
509
+		);
510
+
511
+		$all_posts = new WP_Query( $query_args );
512
+		$post_id = null;
513
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
514
+			global $post;
515
+			$post_id = get_the_ID();
516
+			$post = geodir_get_post_info($post->ID);
517 517
 
518 518
 //            $term_list = wp_get_post_terms($post->ID, 'gd_placecategory');
519 519
 //            $post->gd_placecategory = (string) $term_list[0]->term_id;
520 520
 
521
-            $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_related_listing_widget.php';
522
-            include_once($template);
523
-
524
-            ob_start();
525
-            the_widget( 'geodir_related_listing_postview' );
526
-            $output = ob_get_contents();
527
-            ob_end_clean();
528
-            $this->assertContains('Related Listing', $output);
529
-
530
-            ob_start();
531
-            $this->the_widget_form( 'geodir_related_listing_postview' );
532
-            $output = ob_get_contents();
533
-            ob_end_clean();
534
-            $this->assertContains('Relate to', $output);
535
-
536
-            $new_instance = array(
537
-                'title' => '',
538
-                'list_sort' => '',
539
-                'list_order' => '',
540
-                'post_number' => '5',
541
-                'relate_to' => '',
542
-                'layout' => 'gridview_onehalf',
543
-                'listing_width' => '',
544
-                'add_location_filter' => '1',
545
-                'character_count' => '20'
546
-            );
547
-            $output = $this->the_widget_form_update( 'geodir_related_listing_postview', $new_instance );
548
-            $this->assertContains('gridview_onehalf', $output['layout']);
549
-        endwhile;
550
-
551
-        $this->assertTrue(is_int($post_id));
552
-
553
-
554
-    }
555
-
556
-    public function testReviewsWidget() {
557
-
558
-        $time = current_time('mysql');
559
-
560
-        $args = array(
561
-            'listing_type' => 'gd_place',
562
-            'post_title' => 'Test Listing Title',
563
-            'post_desc' => 'Test Desc',
564
-            'post_tags' => 'test1,test2',
565
-            'post_address' => 'New York City Hall',
566
-            'post_zip' => '10007',
567
-            'post_latitude' => '40.7127837',
568
-            'post_longitude' => '-74.00594130000002',
569
-            'post_mapview' => 'ROADMAP',
570
-            'post_mapzoom' => '10',
571
-            'geodir_timing' => '10.00 am to 6 pm every day',
572
-            'geodir_contact' => '1234567890',
573
-            'geodir_email' => '[email protected]',
574
-            'geodir_website' => 'http://test.com',
575
-            'geodir_twitter' => 'http://twitter.com/test',
576
-            'geodir_facebook' => 'http://facebook.com/test',
577
-            'geodir_special_offers' => 'Test offer'
578
-        );
579
-        $post_id = geodir_save_listing($args, true);
580
-
581
-        $data = array(
582
-            'comment_post_ID' => $post_id,
583
-            'comment_author' => 'admin',
584
-            'comment_author_email' => '[email protected]',
585
-            'comment_author_url' => 'http://wpgeodirectory.com',
586
-            'comment_content' => 'content here',
587
-            'comment_type' => '',
588
-            'comment_parent' => 0,
589
-            'user_id' => 1,
590
-            'comment_author_IP' => '127.0.0.1',
591
-            'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)',
592
-            'comment_date' => $time,
593
-            'comment_approved' => 1,
594
-        );
595
-
596
-        $comment_id = wp_insert_comment($data);
597
-
598
-        $_REQUEST['geodir_overallrating'] = 5.0;
599
-        geodir_save_rating($comment_id);
600
-
601
-        $this->assertTrue(is_int($comment_id));
602
-
603
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_reviews_widget.php';
604
-        include_once($template);
605
-
606
-        ob_start();
607
-        the_widget( 'geodir_recent_reviews_widget' );
608
-        $output = ob_get_contents();
609
-        ob_end_clean();
610
-        $this->assertContains('geodir_recent_reviews', $output);
611
-
612
-        ob_start();
613
-        $this->the_widget_form( 'geodir_recent_reviews_widget' );
614
-        $output = ob_get_contents();
615
-        ob_end_clean();
616
-        $this->assertContains('Number of Reviews', $output);
617
-
618
-        $new_instance = array(
619
-            'title' => '',
620
-            't1' => '',
621
-            't2' => '',
622
-            't3' => '',
623
-            'img1' => '',
624
-            'count' => ''
625
-        );
626
-        $output = $this->the_widget_form_update( 'geodir_recent_reviews_widget', $new_instance );
627
-        $this->assertTrue(empty($output['count']));
628
-    }
629
-
630
-    public function testHomeMapWidget() {
631
-        $template = geodir_plugin_path() . '/geodirectory-widgets/home_map_widget.php';
632
-        include_once($template);
633
-
634
-        ob_start();
635
-        $instance = array();
636
-        $args = array();
637
-        $args["widget_id"] = "geodir_map_v3_home_map-2";
638
-        the_widget( 'geodir_homepage_map', $instance, $args );
639
-        $output = ob_get_contents();
640
-        ob_end_clean();
641
-        $this->assertContains('geodir-map-home-page', $output);
642
-
643
-        ob_start();
644
-        $this->the_widget_form( 'geodir_homepage_map' );
645
-        $output = ob_get_contents();
646
-        ob_end_clean();
647
-        $this->assertContains('Map Zoom level', $output);
648
-
649
-        $new_instance = array(
650
-            'width' => '',
651
-            'heigh' => '',
652
-            'maptype' => '',
653
-            'zoom' => '',
654
-            'autozoom' => '',
655
-            'child_collapse' => '0',
656
-            'scrollwheel' => '0'
657
-        );
658
-        $output = $this->the_widget_form_update( 'geodir_homepage_map', $new_instance );
659
-        $this->assertContains('0', $output['scrollwheel']);
660
-
661
-    }
662
-
663
-    public function testLoginWidget() {
664
-
665
-        register_geodir_widgets();
666
-
667
-        ob_start();
668
-        the_widget( 'geodir_loginwidget' );
669
-        $output = ob_get_contents();
670
-        ob_end_clean();
671
-        $this->assertContains('geodir_loginbox', $output);
672
-
673
-        ob_start();
674
-        $this->the_widget_form( 'geodir_loginwidget' );
675
-        $output = ob_get_contents();
676
-        ob_end_clean();
677
-        $this->assertContains('Widget Title', $output);
678
-
679
-        $new_instance = array(
680
-            'title' => 'Login',
681
-            't1' => '',
682
-            't2' => '',
683
-            't3' => '',
684
-            'img1' => '',
685
-            'desc1' => ''
686
-        );
687
-        $output = $this->the_widget_form_update( 'geodir_loginwidget', $new_instance );
688
-        $this->assertContains('Login', $output['title']);
689
-
690
-    }
691
-
692
-    public function testSocialWidget() {
693
-
694
-        ob_start();
695
-        the_widget( 'geodir_social_like_widget' );
696
-        $output = ob_get_contents();
697
-        ob_end_clean();
698
-        $this->assertContains('twitter.com', $output);
699
-
700
-        ob_start();
701
-        $this->the_widget_form( 'geodir_social_like_widget' );
702
-        $output = ob_get_contents();
703
-        ob_end_clean();
704
-        $this->assertContains('No settings for this widget', $output);
705
-
706
-        $new_instance = array(
707
-            'title' => 'Social',
708
-        );
709
-        $output = $this->the_widget_form_update( 'geodir_social_like_widget', $new_instance );
710
-        $this->assertContains('Social', $output['title']);
711
-
712
-    }
713
-
714
-    public function testSubscribeWidget() {
715
-
716
-        ob_start();
717
-        the_widget( 'geodirsubscribeWidget' );
718
-        $output = ob_get_contents();
719
-        ob_end_clean();
720
-        $this->assertContains('geodir-subscribe-form', $output);
721
-
722
-        ob_start();
723
-        $this->the_widget_form( 'geodirsubscribeWidget' );
724
-        $output = ob_get_contents();
725
-        ob_end_clean();
726
-        $this->assertContains('Feedburner ID', $output);
727
-
728
-        $new_instance = array(
729
-            'title' => 'Subscribe',
730
-            'id' => '',
731
-            'advt1' => '',
732
-            'text' => '',
733
-            'twitter' => '',
734
-            'facebook' => '',
735
-            'digg' => '',
736
-            'myspace' => ''
737
-        );
738
-        $output = $this->the_widget_form_update( 'geodirsubscribeWidget', $new_instance );
739
-        $this->assertContains('Subscribe', $output['title']);
740
-
741
-    }
742
-
743
-    public function testAdvWidget() {
744
-
745
-        ob_start();
746
-        $instance = array();
747
-        $instance['desc1'] = 'hello';
748
-        the_widget( 'geodiradvtwidget', $instance );
749
-        $output = ob_get_contents();
750
-        ob_end_clean();
751
-        $this->assertContains('hello', $output);
752
-
753
-        ob_start();
754
-        $this->the_widget_form( 'geodiradvtwidget' );
755
-        $output = ob_get_contents();
756
-        ob_end_clean();
757
-        $this->assertContains('Your Advt code', $output);
758
-
759
-        $new_instance = array(
760
-            'desc1' => 'Advertise'
761
-        );
762
-        $output = $this->the_widget_form_update( 'geodiradvtwidget', $new_instance );
763
-        $this->assertContains('Advertise', $output['desc1']);
764
-
765
-    }
766
-
767
-    public function testFlickrWidget() {
768
-
769
-        ob_start();
770
-        the_widget( 'GeodirFlickrWidget' );
771
-        $output = ob_get_contents();
772
-        ob_end_clean();
773
-        $this->assertContains('geodir-flickr', $output);
774
-
775
-        ob_start();
776
-        $this->the_widget_form( 'GeodirFlickrWidget' );
777
-        $output = ob_get_contents();
778
-        ob_end_clean();
779
-        $this->assertContains('Flickr ID', $output);
780
-
781
-        $new_instance = array(
782
-            'id' => '',
783
-            'number' => '34'
784
-        );
785
-        $output = $this->the_widget_form_update( 'GeodirFlickrWidget', $new_instance );
786
-        $this->assertContains('34', $output['number']);
787
-
788
-    }
789
-
790
-    public function testTwitterWidget() {
791
-
792
-        ob_start();
793
-        $instance = array();
794
-        $instance['gd_tw_desc1'] = 'hello';
795
-        the_widget( 'geodir_twitter', $instance );
796
-        $output = ob_get_contents();
797
-        ob_end_clean();
798
-        $this->assertContains('hello', $output);
799
-
800
-        ob_start();
801
-        $this->the_widget_form( 'geodir_twitter' );
802
-        $output = ob_get_contents();
803
-        ob_end_clean();
804
-        $this->assertContains('Your twitter code', $output);
805
-
806
-        $new_instance = array(
807
-            'gd_tw_desc1' => 'hello'
808
-        );
809
-        $output = $this->the_widget_form_update( 'geodir_twitter', $new_instance );
810
-        $this->assertContains('hello', $output['gd_tw_desc1']);
811
-
812
-    }
813
-
814
-    public function testAdvSearchWidget() {
815
-
816
-        ob_start();
817
-        the_widget( 'geodir_advance_search_widget' );
818
-        $output = ob_get_contents();
819
-        ob_end_clean();
820
-        $this->assertContains('geodir-loc-bar', $output);
821
-
822
-        ob_start();
823
-        $this->the_widget_form( 'geodir_advance_search_widget' );
824
-        $output = ob_get_contents();
825
-        ob_end_clean();
826
-        $this->assertContains('This is a search widget', $output);
521
+			$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_related_listing_widget.php';
522
+			include_once($template);
523
+
524
+			ob_start();
525
+			the_widget( 'geodir_related_listing_postview' );
526
+			$output = ob_get_contents();
527
+			ob_end_clean();
528
+			$this->assertContains('Related Listing', $output);
529
+
530
+			ob_start();
531
+			$this->the_widget_form( 'geodir_related_listing_postview' );
532
+			$output = ob_get_contents();
533
+			ob_end_clean();
534
+			$this->assertContains('Relate to', $output);
535
+
536
+			$new_instance = array(
537
+				'title' => '',
538
+				'list_sort' => '',
539
+				'list_order' => '',
540
+				'post_number' => '5',
541
+				'relate_to' => '',
542
+				'layout' => 'gridview_onehalf',
543
+				'listing_width' => '',
544
+				'add_location_filter' => '1',
545
+				'character_count' => '20'
546
+			);
547
+			$output = $this->the_widget_form_update( 'geodir_related_listing_postview', $new_instance );
548
+			$this->assertContains('gridview_onehalf', $output['layout']);
549
+		endwhile;
550
+
551
+		$this->assertTrue(is_int($post_id));
552
+
553
+
554
+	}
555
+
556
+	public function testReviewsWidget() {
557
+
558
+		$time = current_time('mysql');
559
+
560
+		$args = array(
561
+			'listing_type' => 'gd_place',
562
+			'post_title' => 'Test Listing Title',
563
+			'post_desc' => 'Test Desc',
564
+			'post_tags' => 'test1,test2',
565
+			'post_address' => 'New York City Hall',
566
+			'post_zip' => '10007',
567
+			'post_latitude' => '40.7127837',
568
+			'post_longitude' => '-74.00594130000002',
569
+			'post_mapview' => 'ROADMAP',
570
+			'post_mapzoom' => '10',
571
+			'geodir_timing' => '10.00 am to 6 pm every day',
572
+			'geodir_contact' => '1234567890',
573
+			'geodir_email' => '[email protected]',
574
+			'geodir_website' => 'http://test.com',
575
+			'geodir_twitter' => 'http://twitter.com/test',
576
+			'geodir_facebook' => 'http://facebook.com/test',
577
+			'geodir_special_offers' => 'Test offer'
578
+		);
579
+		$post_id = geodir_save_listing($args, true);
580
+
581
+		$data = array(
582
+			'comment_post_ID' => $post_id,
583
+			'comment_author' => 'admin',
584
+			'comment_author_email' => '[email protected]',
585
+			'comment_author_url' => 'http://wpgeodirectory.com',
586
+			'comment_content' => 'content here',
587
+			'comment_type' => '',
588
+			'comment_parent' => 0,
589
+			'user_id' => 1,
590
+			'comment_author_IP' => '127.0.0.1',
591
+			'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)',
592
+			'comment_date' => $time,
593
+			'comment_approved' => 1,
594
+		);
595
+
596
+		$comment_id = wp_insert_comment($data);
597
+
598
+		$_REQUEST['geodir_overallrating'] = 5.0;
599
+		geodir_save_rating($comment_id);
600
+
601
+		$this->assertTrue(is_int($comment_id));
602
+
603
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_reviews_widget.php';
604
+		include_once($template);
605
+
606
+		ob_start();
607
+		the_widget( 'geodir_recent_reviews_widget' );
608
+		$output = ob_get_contents();
609
+		ob_end_clean();
610
+		$this->assertContains('geodir_recent_reviews', $output);
611
+
612
+		ob_start();
613
+		$this->the_widget_form( 'geodir_recent_reviews_widget' );
614
+		$output = ob_get_contents();
615
+		ob_end_clean();
616
+		$this->assertContains('Number of Reviews', $output);
617
+
618
+		$new_instance = array(
619
+			'title' => '',
620
+			't1' => '',
621
+			't2' => '',
622
+			't3' => '',
623
+			'img1' => '',
624
+			'count' => ''
625
+		);
626
+		$output = $this->the_widget_form_update( 'geodir_recent_reviews_widget', $new_instance );
627
+		$this->assertTrue(empty($output['count']));
628
+	}
629
+
630
+	public function testHomeMapWidget() {
631
+		$template = geodir_plugin_path() . '/geodirectory-widgets/home_map_widget.php';
632
+		include_once($template);
633
+
634
+		ob_start();
635
+		$instance = array();
636
+		$args = array();
637
+		$args["widget_id"] = "geodir_map_v3_home_map-2";
638
+		the_widget( 'geodir_homepage_map', $instance, $args );
639
+		$output = ob_get_contents();
640
+		ob_end_clean();
641
+		$this->assertContains('geodir-map-home-page', $output);
642
+
643
+		ob_start();
644
+		$this->the_widget_form( 'geodir_homepage_map' );
645
+		$output = ob_get_contents();
646
+		ob_end_clean();
647
+		$this->assertContains('Map Zoom level', $output);
648
+
649
+		$new_instance = array(
650
+			'width' => '',
651
+			'heigh' => '',
652
+			'maptype' => '',
653
+			'zoom' => '',
654
+			'autozoom' => '',
655
+			'child_collapse' => '0',
656
+			'scrollwheel' => '0'
657
+		);
658
+		$output = $this->the_widget_form_update( 'geodir_homepage_map', $new_instance );
659
+		$this->assertContains('0', $output['scrollwheel']);
660
+
661
+	}
662
+
663
+	public function testLoginWidget() {
664
+
665
+		register_geodir_widgets();
666
+
667
+		ob_start();
668
+		the_widget( 'geodir_loginwidget' );
669
+		$output = ob_get_contents();
670
+		ob_end_clean();
671
+		$this->assertContains('geodir_loginbox', $output);
672
+
673
+		ob_start();
674
+		$this->the_widget_form( 'geodir_loginwidget' );
675
+		$output = ob_get_contents();
676
+		ob_end_clean();
677
+		$this->assertContains('Widget Title', $output);
678
+
679
+		$new_instance = array(
680
+			'title' => 'Login',
681
+			't1' => '',
682
+			't2' => '',
683
+			't3' => '',
684
+			'img1' => '',
685
+			'desc1' => ''
686
+		);
687
+		$output = $this->the_widget_form_update( 'geodir_loginwidget', $new_instance );
688
+		$this->assertContains('Login', $output['title']);
689
+
690
+	}
691
+
692
+	public function testSocialWidget() {
693
+
694
+		ob_start();
695
+		the_widget( 'geodir_social_like_widget' );
696
+		$output = ob_get_contents();
697
+		ob_end_clean();
698
+		$this->assertContains('twitter.com', $output);
699
+
700
+		ob_start();
701
+		$this->the_widget_form( 'geodir_social_like_widget' );
702
+		$output = ob_get_contents();
703
+		ob_end_clean();
704
+		$this->assertContains('No settings for this widget', $output);
705
+
706
+		$new_instance = array(
707
+			'title' => 'Social',
708
+		);
709
+		$output = $this->the_widget_form_update( 'geodir_social_like_widget', $new_instance );
710
+		$this->assertContains('Social', $output['title']);
711
+
712
+	}
713
+
714
+	public function testSubscribeWidget() {
715
+
716
+		ob_start();
717
+		the_widget( 'geodirsubscribeWidget' );
718
+		$output = ob_get_contents();
719
+		ob_end_clean();
720
+		$this->assertContains('geodir-subscribe-form', $output);
721
+
722
+		ob_start();
723
+		$this->the_widget_form( 'geodirsubscribeWidget' );
724
+		$output = ob_get_contents();
725
+		ob_end_clean();
726
+		$this->assertContains('Feedburner ID', $output);
727
+
728
+		$new_instance = array(
729
+			'title' => 'Subscribe',
730
+			'id' => '',
731
+			'advt1' => '',
732
+			'text' => '',
733
+			'twitter' => '',
734
+			'facebook' => '',
735
+			'digg' => '',
736
+			'myspace' => ''
737
+		);
738
+		$output = $this->the_widget_form_update( 'geodirsubscribeWidget', $new_instance );
739
+		$this->assertContains('Subscribe', $output['title']);
740
+
741
+	}
742
+
743
+	public function testAdvWidget() {
744
+
745
+		ob_start();
746
+		$instance = array();
747
+		$instance['desc1'] = 'hello';
748
+		the_widget( 'geodiradvtwidget', $instance );
749
+		$output = ob_get_contents();
750
+		ob_end_clean();
751
+		$this->assertContains('hello', $output);
752
+
753
+		ob_start();
754
+		$this->the_widget_form( 'geodiradvtwidget' );
755
+		$output = ob_get_contents();
756
+		ob_end_clean();
757
+		$this->assertContains('Your Advt code', $output);
758
+
759
+		$new_instance = array(
760
+			'desc1' => 'Advertise'
761
+		);
762
+		$output = $this->the_widget_form_update( 'geodiradvtwidget', $new_instance );
763
+		$this->assertContains('Advertise', $output['desc1']);
764
+
765
+	}
766
+
767
+	public function testFlickrWidget() {
768
+
769
+		ob_start();
770
+		the_widget( 'GeodirFlickrWidget' );
771
+		$output = ob_get_contents();
772
+		ob_end_clean();
773
+		$this->assertContains('geodir-flickr', $output);
774
+
775
+		ob_start();
776
+		$this->the_widget_form( 'GeodirFlickrWidget' );
777
+		$output = ob_get_contents();
778
+		ob_end_clean();
779
+		$this->assertContains('Flickr ID', $output);
780
+
781
+		$new_instance = array(
782
+			'id' => '',
783
+			'number' => '34'
784
+		);
785
+		$output = $this->the_widget_form_update( 'GeodirFlickrWidget', $new_instance );
786
+		$this->assertContains('34', $output['number']);
787
+
788
+	}
789
+
790
+	public function testTwitterWidget() {
791
+
792
+		ob_start();
793
+		$instance = array();
794
+		$instance['gd_tw_desc1'] = 'hello';
795
+		the_widget( 'geodir_twitter', $instance );
796
+		$output = ob_get_contents();
797
+		ob_end_clean();
798
+		$this->assertContains('hello', $output);
799
+
800
+		ob_start();
801
+		$this->the_widget_form( 'geodir_twitter' );
802
+		$output = ob_get_contents();
803
+		ob_end_clean();
804
+		$this->assertContains('Your twitter code', $output);
805
+
806
+		$new_instance = array(
807
+			'gd_tw_desc1' => 'hello'
808
+		);
809
+		$output = $this->the_widget_form_update( 'geodir_twitter', $new_instance );
810
+		$this->assertContains('hello', $output['gd_tw_desc1']);
811
+
812
+	}
813
+
814
+	public function testAdvSearchWidget() {
815
+
816
+		ob_start();
817
+		the_widget( 'geodir_advance_search_widget' );
818
+		$output = ob_get_contents();
819
+		ob_end_clean();
820
+		$this->assertContains('geodir-loc-bar', $output);
821
+
822
+		ob_start();
823
+		$this->the_widget_form( 'geodir_advance_search_widget' );
824
+		$output = ob_get_contents();
825
+		ob_end_clean();
826
+		$this->assertContains('This is a search widget', $output);
827 827
 
828 828
 //        $new_instance = array(
829 829
 //        );
830 830
 //        $output = $this->the_widget_form_update( 'geodir_advance_search_widget', $new_instance );
831 831
 //        $this->assertContains('Subscribe', $output['title']);
832 832
 
833
-    }
834
-
835
-    public function testListingMapWidget() {
836
-
837
-        $template = geodir_plugin_path() . '/geodirectory-widgets/listing_map_widget.php';
838
-        include_once($template);
839
-
840
-        //listing page
841
-        $this->go_to( home_url('/?post_type=gd_place') );
842
-
843
-        ob_start();
844
-        $instance = array();
845
-        $args = array();
846
-        $args["widget_id"] = "geodir_map_v3_listing_map-2";
847
-        the_widget( 'geodir_map_listingpage', $instance, $args );
848
-        $output = ob_get_contents();
849
-        ob_end_clean();
850
-        $this->assertContains('geodir-map-listing-page', $output);
851
-
852
-        // detail page
853
-        $query_args = array(
854
-            'post_status' => 'publish',
855
-            'post_type' => 'gd_place',
856
-            'posts_per_page' => 1,
857
-        );
858
-
859
-        $all_posts = new WP_Query( $query_args );
860
-        $post_id = null;
861
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
862
-            $post_id = get_the_ID();
863
-        endwhile;
864
-
865
-        $this->assertTrue(is_int($post_id));
866
-
867
-        $this->go_to( get_permalink($post_id) );
868
-
869
-        ob_start();
870
-        $instance = array();
871
-        $args = array();
872
-        $args["widget_id"] = "geodir_map_v3_listing_map-2";
873
-        the_widget( 'geodir_map_listingpage', $instance, $args );
874
-        $output = ob_get_contents();
875
-        ob_end_clean();
876
-        $this->assertContains('geodir-map-listing-page', $output);
877
-
878
-        ob_start();
879
-        $this->the_widget_form( 'geodir_map_listingpage' );
880
-        $output = ob_get_contents();
881
-        ob_end_clean();
882
-        $this->assertContains('Select Map View', $output);
883
-
884
-        $new_instance = array(
885
-            'width' => '',
886
-            'heigh' => '',
887
-            'maptype' => '',
888
-            'zoom' => '',
889
-            'autozoom' => '',
890
-            'sticky' => '',
891
-            'scrollwheel' => '0',
892
-            'showall' => '0'
893
-        );
894
-        $output = $this->the_widget_form_update( 'geodir_map_listingpage', $new_instance );
895
-        $this->assertContains('0', $output['scrollwheel']);
896
-
897
-
898
-    }
899
-
900
-    private function load_template() {
901
-        do_action( 'template_redirect' );
902
-        $template = false;
903
-        if	 ( is_404()			&& $template = get_404_template()			) :
904
-        elseif ( is_search()		 && $template = get_search_template()		 ) :
905
-        elseif ( is_front_page()	 && $template = get_front_page_template()	 ) :
906
-        elseif ( is_home()		   && $template = get_home_template()		   ) :
907
-        elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) :
908
-        elseif ( is_tax()			&& $template = get_taxonomy_template()	   ) :
909
-        elseif ( is_attachment()	 && $template = get_attachment_template()	 ) :
910
-            remove_filter('the_content', 'prepend_attachment');
911
-        elseif ( is_single()		 && $template = get_single_template()		 ) :
912
-        elseif ( is_page()		   && $template = get_page_template()		   ) :
913
-        elseif ( is_category()	   && $template = get_category_template()	   ) :
914
-        elseif ( is_tag()			&& $template = get_tag_template()			) :
915
-        elseif ( is_author()		 && $template = get_author_template()		 ) :
916
-        elseif ( is_date()		   && $template = get_date_template()		   ) :
917
-        elseif ( is_archive()		&& $template = get_archive_template()		) :
918
-        elseif ( is_paged()		  && $template = get_paged_template()		  ) :
919
-        else :
920
-            $template = get_index_template();
921
-        endif;
922
-        /**
923
-         * Filter the path of the current template before including it.
924
-         *
925
-         * @since 3.0.0
926
-         *
927
-         * @param string $template The path of the template to include.
928
-         */
929
-        if ( $template = apply_filters( 'template_include', $template ) ) {
930
-            $template_contents = file_get_contents( $template );
931
-            $included_header = $included_footer = false;
932
-            if ( false !== stripos( $template_contents, 'get_header();' ) ) {
933
-                do_action( 'get_header', null );
934
-                locate_template( 'header.php', true, false );
935
-                $included_header = true;
936
-            }
937
-            include( $template );
938
-            if ( false !== stripos( $template_contents, 'get_footer();' ) ) {
939
-                do_action( 'get_footer', null );
940
-                locate_template( 'footer.php', true, false );
941
-                $included_footer = true;
942
-            }
943
-            if ( $included_header && $included_footer ) {
944
-                global $wp_scripts;
945
-                $wp_scripts->done = array();
946
-            }
947
-        }
948
-        return;
949
-    }
950
-
951
-    public static function setPermalinkStructure( $struc = '/%postname%/' ) {
952
-        global $wp_rewrite;
953
-        $wp_rewrite->set_permalink_structure( $struc );
954
-        $wp_rewrite->flush_rules();
955
-        update_option( 'permalink_structure', $struc );
956
-        flush_rewrite_rules( true );
957
-    }
958
-
959
-    function the_widget_form( $widget, $instance = array() ) {
960
-        global $wp_widget_factory;
961
-
962
-        $widget_obj = $wp_widget_factory->widgets[$widget];
963
-        if ( ! ( $widget_obj instanceof WP_Widget ) ) {
964
-            return;
965
-        }
966
-
967
-        $widget_obj->_set(-1);
968
-        $widget_obj->form($instance);
969
-    }
970
-
971
-    function the_widget_form_update( $widget, $new_instance = array(), $old_instance = array() ) {
972
-        global $wp_widget_factory;
973
-
974
-        $widget_obj = $wp_widget_factory->widgets[$widget];
975
-        if ( ! ( $widget_obj instanceof WP_Widget ) ) {
976
-            return;
977
-        }
978
-
979
-        $widget_obj->_set(-1);
980
-        return $widget_obj->update($new_instance, $old_instance);
981
-    }
982
-
983
-
984
-    public function tearDown()
985
-    {
986
-        parent::tearDown();
987
-    }
833
+	}
834
+
835
+	public function testListingMapWidget() {
836
+
837
+		$template = geodir_plugin_path() . '/geodirectory-widgets/listing_map_widget.php';
838
+		include_once($template);
839
+
840
+		//listing page
841
+		$this->go_to( home_url('/?post_type=gd_place') );
842
+
843
+		ob_start();
844
+		$instance = array();
845
+		$args = array();
846
+		$args["widget_id"] = "geodir_map_v3_listing_map-2";
847
+		the_widget( 'geodir_map_listingpage', $instance, $args );
848
+		$output = ob_get_contents();
849
+		ob_end_clean();
850
+		$this->assertContains('geodir-map-listing-page', $output);
851
+
852
+		// detail page
853
+		$query_args = array(
854
+			'post_status' => 'publish',
855
+			'post_type' => 'gd_place',
856
+			'posts_per_page' => 1,
857
+		);
858
+
859
+		$all_posts = new WP_Query( $query_args );
860
+		$post_id = null;
861
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
862
+			$post_id = get_the_ID();
863
+		endwhile;
864
+
865
+		$this->assertTrue(is_int($post_id));
866
+
867
+		$this->go_to( get_permalink($post_id) );
868
+
869
+		ob_start();
870
+		$instance = array();
871
+		$args = array();
872
+		$args["widget_id"] = "geodir_map_v3_listing_map-2";
873
+		the_widget( 'geodir_map_listingpage', $instance, $args );
874
+		$output = ob_get_contents();
875
+		ob_end_clean();
876
+		$this->assertContains('geodir-map-listing-page', $output);
877
+
878
+		ob_start();
879
+		$this->the_widget_form( 'geodir_map_listingpage' );
880
+		$output = ob_get_contents();
881
+		ob_end_clean();
882
+		$this->assertContains('Select Map View', $output);
883
+
884
+		$new_instance = array(
885
+			'width' => '',
886
+			'heigh' => '',
887
+			'maptype' => '',
888
+			'zoom' => '',
889
+			'autozoom' => '',
890
+			'sticky' => '',
891
+			'scrollwheel' => '0',
892
+			'showall' => '0'
893
+		);
894
+		$output = $this->the_widget_form_update( 'geodir_map_listingpage', $new_instance );
895
+		$this->assertContains('0', $output['scrollwheel']);
896
+
897
+
898
+	}
899
+
900
+	private function load_template() {
901
+		do_action( 'template_redirect' );
902
+		$template = false;
903
+		if	 ( is_404()			&& $template = get_404_template()			) :
904
+		elseif ( is_search()		 && $template = get_search_template()		 ) :
905
+		elseif ( is_front_page()	 && $template = get_front_page_template()	 ) :
906
+		elseif ( is_home()		   && $template = get_home_template()		   ) :
907
+		elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) :
908
+		elseif ( is_tax()			&& $template = get_taxonomy_template()	   ) :
909
+		elseif ( is_attachment()	 && $template = get_attachment_template()	 ) :
910
+			remove_filter('the_content', 'prepend_attachment');
911
+		elseif ( is_single()		 && $template = get_single_template()		 ) :
912
+		elseif ( is_page()		   && $template = get_page_template()		   ) :
913
+		elseif ( is_category()	   && $template = get_category_template()	   ) :
914
+		elseif ( is_tag()			&& $template = get_tag_template()			) :
915
+		elseif ( is_author()		 && $template = get_author_template()		 ) :
916
+		elseif ( is_date()		   && $template = get_date_template()		   ) :
917
+		elseif ( is_archive()		&& $template = get_archive_template()		) :
918
+		elseif ( is_paged()		  && $template = get_paged_template()		  ) :
919
+		else :
920
+			$template = get_index_template();
921
+		endif;
922
+		/**
923
+		 * Filter the path of the current template before including it.
924
+		 *
925
+		 * @since 3.0.0
926
+		 *
927
+		 * @param string $template The path of the template to include.
928
+		 */
929
+		if ( $template = apply_filters( 'template_include', $template ) ) {
930
+			$template_contents = file_get_contents( $template );
931
+			$included_header = $included_footer = false;
932
+			if ( false !== stripos( $template_contents, 'get_header();' ) ) {
933
+				do_action( 'get_header', null );
934
+				locate_template( 'header.php', true, false );
935
+				$included_header = true;
936
+			}
937
+			include( $template );
938
+			if ( false !== stripos( $template_contents, 'get_footer();' ) ) {
939
+				do_action( 'get_footer', null );
940
+				locate_template( 'footer.php', true, false );
941
+				$included_footer = true;
942
+			}
943
+			if ( $included_header && $included_footer ) {
944
+				global $wp_scripts;
945
+				$wp_scripts->done = array();
946
+			}
947
+		}
948
+		return;
949
+	}
950
+
951
+	public static function setPermalinkStructure( $struc = '/%postname%/' ) {
952
+		global $wp_rewrite;
953
+		$wp_rewrite->set_permalink_structure( $struc );
954
+		$wp_rewrite->flush_rules();
955
+		update_option( 'permalink_structure', $struc );
956
+		flush_rewrite_rules( true );
957
+	}
958
+
959
+	function the_widget_form( $widget, $instance = array() ) {
960
+		global $wp_widget_factory;
961
+
962
+		$widget_obj = $wp_widget_factory->widgets[$widget];
963
+		if ( ! ( $widget_obj instanceof WP_Widget ) ) {
964
+			return;
965
+		}
966
+
967
+		$widget_obj->_set(-1);
968
+		$widget_obj->form($instance);
969
+	}
970
+
971
+	function the_widget_form_update( $widget, $new_instance = array(), $old_instance = array() ) {
972
+		global $wp_widget_factory;
973
+
974
+		$widget_obj = $wp_widget_factory->widgets[$widget];
975
+		if ( ! ( $widget_obj instanceof WP_Widget ) ) {
976
+			return;
977
+		}
978
+
979
+		$widget_obj->_set(-1);
980
+		return $widget_obj->update($new_instance, $old_instance);
981
+	}
982
+
983
+
984
+	public function tearDown()
985
+	{
986
+		parent::tearDown();
987
+	}
988 988
 }
989 989
 ?>
990 990
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@  discard block
 block discarded – undo
16 16
             'posts_per_page' => 1,
17 17
         );
18 18
 
19
-        $all_posts = new WP_Query( $query_args );
19
+        $all_posts = new WP_Query($query_args);
20 20
         $post_id = null;
21
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
21
+        while ($all_posts->have_posts()) : $all_posts->the_post();
22 22
             $post_id = get_the_ID();
23 23
         endwhile;
24 24
 
25 25
         $this->assertTrue(is_int($post_id));
26 26
 
27
-        $this->go_to( get_permalink($post_id) );
27
+        $this->go_to(get_permalink($post_id));
28 28
 
29 29
         ob_start();
30 30
         geodir_breadcrumb();
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 //            'before_title' => '<ul>',
120 120
 //            'after_title' => '<ul>'
121 121
 //        );
122
-        include_once geodir_plugin_path() . "/geodirectory-widgets/geodirectory_cpt_categories_widget.php";
122
+        include_once geodir_plugin_path()."/geodirectory-widgets/geodirectory_cpt_categories_widget.php";
123 123
         $params = array(
124 124
             'title' => '',
125 125
             'post_type' => array(), // NULL for all
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
     public function testRegTemplate() {
178 178
 //        var_dump(geodir_login_page_id());
179 179
         wp_set_current_user(0);
180
-        $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php';
180
+        $template = geodir_plugin_path().'/geodirectory-templates/geodir-signup.php';
181 181
 
182 182
         ob_start();
183 183
         include($template);
@@ -194,15 +194,15 @@  discard block
 block discarded – undo
194 194
 
195 195
         $this->setPermalinkStructure();
196 196
 
197
-        $homepage = get_page_by_title( 'GD Home page' );
198
-        if ( $homepage )
197
+        $homepage = get_page_by_title('GD Home page');
198
+        if ($homepage)
199 199
         {
200
-            update_option( 'page_on_front', $homepage->ID );
201
-            update_option( 'show_on_front', 'page' );
200
+            update_option('page_on_front', $homepage->ID);
201
+            update_option('show_on_front', 'page');
202 202
         }
203 203
 
204 204
         ob_start();
205
-        $this->go_to( home_url('/') );
205
+        $this->go_to(home_url('/'));
206 206
         $this->load_template();
207 207
         $output = ob_get_contents();
208 208
         ob_end_clean();
@@ -210,14 +210,14 @@  discard block
 block discarded – undo
210 210
 
211 211
 
212 212
         ob_start();
213
-        $this->go_to( home_url('/?post_type=gd_place') );
213
+        $this->go_to(home_url('/?post_type=gd_place'));
214 214
         $this->load_template();
215 215
         $output = ob_get_contents();
216 216
         ob_end_clean();
217 217
         $this->assertContains('All Places', $output);
218 218
 
219 219
         ob_start();
220
-        $this->go_to( home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon=') );
220
+        $this->go_to(home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon='));
221 221
         $this->load_template();
222 222
         $output = ob_get_contents();
223 223
         ob_end_clean();
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
             'posts_per_page' => 1,
230 230
         );
231 231
 
232
-        $all_posts = new WP_Query( $query_args );
232
+        $all_posts = new WP_Query($query_args);
233 233
         $post_id = null;
234
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
234
+        while ($all_posts->have_posts()) : $all_posts->the_post();
235 235
             $post_id = get_the_ID();
236 236
         endwhile;
237 237
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         global $preview;
241 241
         $preview = false;
242 242
         ob_start();
243
-        $this->go_to( get_permalink($post_id) );
243
+        $this->go_to(get_permalink($post_id));
244 244
         $this->load_template();
245 245
         $output = ob_get_contents();
246 246
         ob_end_clean();
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
         ob_start();
250 250
         $_REQUEST['stype'] = 'gd_place';
251 251
         $_REQUEST['geodir_dashbord'] = true;
252
-        $this->go_to( get_author_posts_url($user_id) );
252
+        $this->go_to(get_author_posts_url($user_id));
253 253
         $this->load_template();
254 254
         $output = ob_get_contents();
255 255
         ob_end_clean();
@@ -261,23 +261,23 @@  discard block
 block discarded – undo
261 261
         $menuname = 'Primary Menu';
262 262
         $menulocation = 'primary';
263 263
         // Does the menu exist already?
264
-        $menu_exists = wp_get_nav_menu_object( $menuname );
264
+        $menu_exists = wp_get_nav_menu_object($menuname);
265 265
 
266 266
         // If it doesn't exist, let's create it.
267
-        if( !$menu_exists){
267
+        if (!$menu_exists) {
268 268
             $menu_id = wp_create_nav_menu($menuname);
269 269
 
270 270
             // Set up default BuddyPress links and add them to the menu.
271 271
             wp_update_nav_menu_item($menu_id, 0, array(
272 272
                 'menu-item-title' =>  __('Home'),
273 273
                 'menu-item-classes' => 'home',
274
-                'menu-item-url' => home_url( '/' ),
274
+                'menu-item-url' => home_url('/'),
275 275
                 'menu-item-status' => 'publish'));
276 276
 
277
-            if( !has_nav_menu( $menulocation ) ){
277
+            if (!has_nav_menu($menulocation)) {
278 278
                 $locations = get_theme_mod('nav_menu_locations');
279 279
                 $locations[$menulocation] = $menu_id;
280
-                set_theme_mod( 'nav_menu_locations', $locations );
280
+                set_theme_mod('nav_menu_locations', $locations);
281 281
             }
282 282
 
283 283
             update_option('geodir_theme_location_nav', array('primary'));
@@ -294,20 +294,20 @@  discard block
 block discarded – undo
294 294
     }
295 295
 
296 296
     public function testBestOfWidget() {
297
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php';
297
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_bestof_widget.php';
298 298
         include_once($template);
299 299
 
300 300
         ob_start();
301 301
         $instance = array();
302 302
         $instance['use_viewing_post_type'] = '1';
303 303
         $instance['excerpt_type'] = 'show-reviews';
304
-        the_widget( 'geodir_bestof_widget' );
304
+        the_widget('geodir_bestof_widget');
305 305
         $output = ob_get_contents();
306 306
         ob_end_clean();
307 307
         $this->assertContains('bestof-widget-tab-layout', $output);
308 308
 
309 309
         ob_start();
310
-        $this->the_widget_form( 'geodir_bestof_widget' );
310
+        $this->the_widget_form('geodir_bestof_widget');
311 311
         $output = ob_get_contents();
312 312
         ob_end_clean();
313 313
         $this->assertContains('Number of categories', $output);
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
             'excerpt_type' => 'show-desc',
324 324
             'use_viewing_post_type' => '1'
325 325
         );
326
-        $output = $this->the_widget_form_update( 'geodir_bestof_widget', $new_instance );
326
+        $output = $this->the_widget_form_update('geodir_bestof_widget', $new_instance);
327 327
         $this->assertContains('20', $output['character_count']);
328 328
 
329 329
         ob_start();
@@ -335,17 +335,17 @@  discard block
 block discarded – undo
335 335
     }
336 336
 
337 337
     public function testCptCatsWidget() {
338
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_cpt_categories_widget.php';
338
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_cpt_categories_widget.php';
339 339
         include_once($template);
340 340
 
341 341
         ob_start();
342
-        the_widget( 'geodir_cpt_categories_widget' );
342
+        the_widget('geodir_cpt_categories_widget');
343 343
         $output = ob_get_contents();
344 344
         ob_end_clean();
345 345
         $this->assertContains('geodir_cpt_categories_widget', $output);
346 346
 
347 347
         ob_start();
348
-        $this->the_widget_form( 'geodir_cpt_categories_widget' );
348
+        $this->the_widget_form('geodir_cpt_categories_widget');
349 349
         $output = ob_get_contents();
350 350
         ob_end_clean();
351 351
         $this->assertContains('Select CPT', $output);
@@ -361,13 +361,13 @@  discard block
 block discarded – undo
361 361
             'max_count' => 'all',
362 362
             'max_level' => '1'
363 363
         );
364
-        $output = $this->the_widget_form_update( 'geodir_cpt_categories_widget', $new_instance );
364
+        $output = $this->the_widget_form_update('geodir_cpt_categories_widget', $new_instance);
365 365
         $this->assertContains('count', $output['sort_by']);
366 366
 
367 367
     }
368 368
 
369 369
     public function testFeaturesWidget() {
370
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_features_widget.php';
370
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_features_widget.php';
371 371
         include_once($template);
372 372
 
373 373
         $instance = array(
@@ -379,13 +379,13 @@  discard block
 block discarded – undo
379 379
         );
380 380
 
381 381
         ob_start();
382
-        the_widget( 'Geodir_Features_Widget', $instance);
382
+        the_widget('Geodir_Features_Widget', $instance);
383 383
         $output = ob_get_contents();
384 384
         ob_end_clean();
385 385
         $this->assertContains('widget_gd_features', $output);
386 386
 
387 387
         ob_start();
388
-        $this->the_widget_form( 'Geodir_Features_Widget', $instance );
388
+        $this->the_widget_form('Geodir_Features_Widget', $instance);
389 389
         $output = ob_get_contents();
390 390
         ob_end_clean();
391 391
         $this->assertContains('Font Awesome Icon Color', $output);
@@ -397,23 +397,23 @@  discard block
 block discarded – undo
397 397
             'image1' => 'fa-recycle',
398 398
             'desc1' => 'cool',
399 399
         );
400
-        $output = $this->the_widget_form_update( 'Geodir_Features_Widget', $new_instance );
400
+        $output = $this->the_widget_form_update('Geodir_Features_Widget', $new_instance);
401 401
         $this->assertContains('Features', $output['title']);
402 402
 
403 403
     }
404 404
 
405 405
     public function testSliderWidget() {
406
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_listing_slider_widget.php';
406
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_listing_slider_widget.php';
407 407
         include_once($template);
408 408
 
409 409
         ob_start();
410
-        the_widget( 'geodir_listing_slider_widget' );
410
+        the_widget('geodir_listing_slider_widget');
411 411
         $output = ob_get_contents();
412 412
         ob_end_clean();
413 413
         $this->assertContains('geodir_listing_slider_view', $output);
414 414
 
415 415
         ob_start();
416
-        $this->the_widget_form( 'geodir_listing_slider_widget' );
416
+        $this->the_widget_form('geodir_listing_slider_widget');
417 417
         $output = ob_get_contents();
418 418
         ob_end_clean();
419 419
         $this->assertContains('Slide Show Speed', $output);
@@ -435,23 +435,23 @@  discard block
 block discarded – undo
435 435
             'list_sort' => 'latest',
436 436
             'show_featured_only' => '',
437 437
         );
438
-        $output = $this->the_widget_form_update( 'geodir_listing_slider_widget', $new_instance );
438
+        $output = $this->the_widget_form_update('geodir_listing_slider_widget', $new_instance);
439 439
         $this->assertContains('latest', $output['list_sort']);
440 440
 
441 441
     }
442 442
 
443 443
     public function testPopularWidget() {
444
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_popular_widget.php';
444
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_popular_widget.php';
445 445
         include_once($template);
446 446
 
447 447
         ob_start();
448
-        the_widget( 'geodir_popular_post_category' );
448
+        the_widget('geodir_popular_post_category');
449 449
         $output = ob_get_contents();
450 450
         ob_end_clean();
451 451
         $this->assertContains('geodir_popular_post_category', $output);
452 452
 
453 453
         ob_start();
454
-        $this->the_widget_form( 'geodir_popular_post_category' );
454
+        $this->the_widget_form('geodir_popular_post_category');
455 455
         $output = ob_get_contents();
456 456
         ob_end_clean();
457 457
         $this->assertContains('Default post type to use', $output);
@@ -461,19 +461,19 @@  discard block
 block discarded – undo
461 461
             'category_limit' => 15,
462 462
             'default_post_type' => ''
463 463
         );
464
-        $output = $this->the_widget_form_update( 'geodir_popular_post_category', $new_instance );
464
+        $output = $this->the_widget_form_update('geodir_popular_post_category', $new_instance);
465 465
         $this->assertEquals(15, $output['category_limit']);
466 466
 
467 467
         ob_start();
468 468
         $instance = array();
469 469
         $instance['category_title'] = '';
470
-        the_widget( 'geodir_popular_postview', $instance );
470
+        the_widget('geodir_popular_postview', $instance);
471 471
         $output = ob_get_contents();
472 472
         ob_end_clean();
473 473
         $this->assertContains('geodir_popular_post_view', $output);
474 474
 
475 475
         ob_start();
476
-        $this->the_widget_form( 'geodir_popular_postview' );
476
+        $this->the_widget_form('geodir_popular_postview');
477 477
         $output = ob_get_contents();
478 478
         ob_end_clean();
479 479
         $this->assertContains('Post Category', $output);
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
             'with_videos_only' => '',
497 497
             'use_viewing_post_type' => ''
498 498
         );
499
-        $output = $this->the_widget_form_update( 'geodir_popular_postview', $new_instance );
499
+        $output = $this->the_widget_form_update('geodir_popular_postview', $new_instance);
500 500
         $this->assertContains('gridview_onehalf', $output['layout']);
501 501
 
502 502
     }
@@ -508,9 +508,9 @@  discard block
 block discarded – undo
508 508
             'posts_per_page' => 1,
509 509
         );
510 510
 
511
-        $all_posts = new WP_Query( $query_args );
511
+        $all_posts = new WP_Query($query_args);
512 512
         $post_id = null;
513
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
513
+        while ($all_posts->have_posts()) : $all_posts->the_post();
514 514
             global $post;
515 515
             $post_id = get_the_ID();
516 516
             $post = geodir_get_post_info($post->ID);
@@ -518,17 +518,17 @@  discard block
 block discarded – undo
518 518
 //            $term_list = wp_get_post_terms($post->ID, 'gd_placecategory');
519 519
 //            $post->gd_placecategory = (string) $term_list[0]->term_id;
520 520
 
521
-            $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_related_listing_widget.php';
521
+            $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_related_listing_widget.php';
522 522
             include_once($template);
523 523
 
524 524
             ob_start();
525
-            the_widget( 'geodir_related_listing_postview' );
525
+            the_widget('geodir_related_listing_postview');
526 526
             $output = ob_get_contents();
527 527
             ob_end_clean();
528 528
             $this->assertContains('Related Listing', $output);
529 529
 
530 530
             ob_start();
531
-            $this->the_widget_form( 'geodir_related_listing_postview' );
531
+            $this->the_widget_form('geodir_related_listing_postview');
532 532
             $output = ob_get_contents();
533 533
             ob_end_clean();
534 534
             $this->assertContains('Relate to', $output);
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
                 'add_location_filter' => '1',
545 545
                 'character_count' => '20'
546 546
             );
547
-            $output = $this->the_widget_form_update( 'geodir_related_listing_postview', $new_instance );
547
+            $output = $this->the_widget_form_update('geodir_related_listing_postview', $new_instance);
548 548
             $this->assertContains('gridview_onehalf', $output['layout']);
549 549
         endwhile;
550 550
 
@@ -600,17 +600,17 @@  discard block
 block discarded – undo
600 600
 
601 601
         $this->assertTrue(is_int($comment_id));
602 602
 
603
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_reviews_widget.php';
603
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_reviews_widget.php';
604 604
         include_once($template);
605 605
 
606 606
         ob_start();
607
-        the_widget( 'geodir_recent_reviews_widget' );
607
+        the_widget('geodir_recent_reviews_widget');
608 608
         $output = ob_get_contents();
609 609
         ob_end_clean();
610 610
         $this->assertContains('geodir_recent_reviews', $output);
611 611
 
612 612
         ob_start();
613
-        $this->the_widget_form( 'geodir_recent_reviews_widget' );
613
+        $this->the_widget_form('geodir_recent_reviews_widget');
614 614
         $output = ob_get_contents();
615 615
         ob_end_clean();
616 616
         $this->assertContains('Number of Reviews', $output);
@@ -623,25 +623,25 @@  discard block
 block discarded – undo
623 623
             'img1' => '',
624 624
             'count' => ''
625 625
         );
626
-        $output = $this->the_widget_form_update( 'geodir_recent_reviews_widget', $new_instance );
626
+        $output = $this->the_widget_form_update('geodir_recent_reviews_widget', $new_instance);
627 627
         $this->assertTrue(empty($output['count']));
628 628
     }
629 629
 
630 630
     public function testHomeMapWidget() {
631
-        $template = geodir_plugin_path() . '/geodirectory-widgets/home_map_widget.php';
631
+        $template = geodir_plugin_path().'/geodirectory-widgets/home_map_widget.php';
632 632
         include_once($template);
633 633
 
634 634
         ob_start();
635 635
         $instance = array();
636 636
         $args = array();
637 637
         $args["widget_id"] = "geodir_map_v3_home_map-2";
638
-        the_widget( 'geodir_homepage_map', $instance, $args );
638
+        the_widget('geodir_homepage_map', $instance, $args);
639 639
         $output = ob_get_contents();
640 640
         ob_end_clean();
641 641
         $this->assertContains('geodir-map-home-page', $output);
642 642
 
643 643
         ob_start();
644
-        $this->the_widget_form( 'geodir_homepage_map' );
644
+        $this->the_widget_form('geodir_homepage_map');
645 645
         $output = ob_get_contents();
646 646
         ob_end_clean();
647 647
         $this->assertContains('Map Zoom level', $output);
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
             'child_collapse' => '0',
656 656
             'scrollwheel' => '0'
657 657
         );
658
-        $output = $this->the_widget_form_update( 'geodir_homepage_map', $new_instance );
658
+        $output = $this->the_widget_form_update('geodir_homepage_map', $new_instance);
659 659
         $this->assertContains('0', $output['scrollwheel']);
660 660
 
661 661
     }
@@ -665,13 +665,13 @@  discard block
 block discarded – undo
665 665
         register_geodir_widgets();
666 666
 
667 667
         ob_start();
668
-        the_widget( 'geodir_loginwidget' );
668
+        the_widget('geodir_loginwidget');
669 669
         $output = ob_get_contents();
670 670
         ob_end_clean();
671 671
         $this->assertContains('geodir_loginbox', $output);
672 672
 
673 673
         ob_start();
674
-        $this->the_widget_form( 'geodir_loginwidget' );
674
+        $this->the_widget_form('geodir_loginwidget');
675 675
         $output = ob_get_contents();
676 676
         ob_end_clean();
677 677
         $this->assertContains('Widget Title', $output);
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
             'img1' => '',
685 685
             'desc1' => ''
686 686
         );
687
-        $output = $this->the_widget_form_update( 'geodir_loginwidget', $new_instance );
687
+        $output = $this->the_widget_form_update('geodir_loginwidget', $new_instance);
688 688
         $this->assertContains('Login', $output['title']);
689 689
 
690 690
     }
@@ -692,13 +692,13 @@  discard block
 block discarded – undo
692 692
     public function testSocialWidget() {
693 693
 
694 694
         ob_start();
695
-        the_widget( 'geodir_social_like_widget' );
695
+        the_widget('geodir_social_like_widget');
696 696
         $output = ob_get_contents();
697 697
         ob_end_clean();
698 698
         $this->assertContains('twitter.com', $output);
699 699
 
700 700
         ob_start();
701
-        $this->the_widget_form( 'geodir_social_like_widget' );
701
+        $this->the_widget_form('geodir_social_like_widget');
702 702
         $output = ob_get_contents();
703 703
         ob_end_clean();
704 704
         $this->assertContains('No settings for this widget', $output);
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
         $new_instance = array(
707 707
             'title' => 'Social',
708 708
         );
709
-        $output = $this->the_widget_form_update( 'geodir_social_like_widget', $new_instance );
709
+        $output = $this->the_widget_form_update('geodir_social_like_widget', $new_instance);
710 710
         $this->assertContains('Social', $output['title']);
711 711
 
712 712
     }
@@ -714,13 +714,13 @@  discard block
 block discarded – undo
714 714
     public function testSubscribeWidget() {
715 715
 
716 716
         ob_start();
717
-        the_widget( 'geodirsubscribeWidget' );
717
+        the_widget('geodirsubscribeWidget');
718 718
         $output = ob_get_contents();
719 719
         ob_end_clean();
720 720
         $this->assertContains('geodir-subscribe-form', $output);
721 721
 
722 722
         ob_start();
723
-        $this->the_widget_form( 'geodirsubscribeWidget' );
723
+        $this->the_widget_form('geodirsubscribeWidget');
724 724
         $output = ob_get_contents();
725 725
         ob_end_clean();
726 726
         $this->assertContains('Feedburner ID', $output);
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
             'digg' => '',
736 736
             'myspace' => ''
737 737
         );
738
-        $output = $this->the_widget_form_update( 'geodirsubscribeWidget', $new_instance );
738
+        $output = $this->the_widget_form_update('geodirsubscribeWidget', $new_instance);
739 739
         $this->assertContains('Subscribe', $output['title']);
740 740
 
741 741
     }
@@ -745,13 +745,13 @@  discard block
 block discarded – undo
745 745
         ob_start();
746 746
         $instance = array();
747 747
         $instance['desc1'] = 'hello';
748
-        the_widget( 'geodiradvtwidget', $instance );
748
+        the_widget('geodiradvtwidget', $instance);
749 749
         $output = ob_get_contents();
750 750
         ob_end_clean();
751 751
         $this->assertContains('hello', $output);
752 752
 
753 753
         ob_start();
754
-        $this->the_widget_form( 'geodiradvtwidget' );
754
+        $this->the_widget_form('geodiradvtwidget');
755 755
         $output = ob_get_contents();
756 756
         ob_end_clean();
757 757
         $this->assertContains('Your Advt code', $output);
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
         $new_instance = array(
760 760
             'desc1' => 'Advertise'
761 761
         );
762
-        $output = $this->the_widget_form_update( 'geodiradvtwidget', $new_instance );
762
+        $output = $this->the_widget_form_update('geodiradvtwidget', $new_instance);
763 763
         $this->assertContains('Advertise', $output['desc1']);
764 764
 
765 765
     }
@@ -767,13 +767,13 @@  discard block
 block discarded – undo
767 767
     public function testFlickrWidget() {
768 768
 
769 769
         ob_start();
770
-        the_widget( 'GeodirFlickrWidget' );
770
+        the_widget('GeodirFlickrWidget');
771 771
         $output = ob_get_contents();
772 772
         ob_end_clean();
773 773
         $this->assertContains('geodir-flickr', $output);
774 774
 
775 775
         ob_start();
776
-        $this->the_widget_form( 'GeodirFlickrWidget' );
776
+        $this->the_widget_form('GeodirFlickrWidget');
777 777
         $output = ob_get_contents();
778 778
         ob_end_clean();
779 779
         $this->assertContains('Flickr ID', $output);
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
             'id' => '',
783 783
             'number' => '34'
784 784
         );
785
-        $output = $this->the_widget_form_update( 'GeodirFlickrWidget', $new_instance );
785
+        $output = $this->the_widget_form_update('GeodirFlickrWidget', $new_instance);
786 786
         $this->assertContains('34', $output['number']);
787 787
 
788 788
     }
@@ -792,13 +792,13 @@  discard block
 block discarded – undo
792 792
         ob_start();
793 793
         $instance = array();
794 794
         $instance['gd_tw_desc1'] = 'hello';
795
-        the_widget( 'geodir_twitter', $instance );
795
+        the_widget('geodir_twitter', $instance);
796 796
         $output = ob_get_contents();
797 797
         ob_end_clean();
798 798
         $this->assertContains('hello', $output);
799 799
 
800 800
         ob_start();
801
-        $this->the_widget_form( 'geodir_twitter' );
801
+        $this->the_widget_form('geodir_twitter');
802 802
         $output = ob_get_contents();
803 803
         ob_end_clean();
804 804
         $this->assertContains('Your twitter code', $output);
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
         $new_instance = array(
807 807
             'gd_tw_desc1' => 'hello'
808 808
         );
809
-        $output = $this->the_widget_form_update( 'geodir_twitter', $new_instance );
809
+        $output = $this->the_widget_form_update('geodir_twitter', $new_instance);
810 810
         $this->assertContains('hello', $output['gd_tw_desc1']);
811 811
 
812 812
     }
@@ -814,13 +814,13 @@  discard block
 block discarded – undo
814 814
     public function testAdvSearchWidget() {
815 815
 
816 816
         ob_start();
817
-        the_widget( 'geodir_advance_search_widget' );
817
+        the_widget('geodir_advance_search_widget');
818 818
         $output = ob_get_contents();
819 819
         ob_end_clean();
820 820
         $this->assertContains('geodir-loc-bar', $output);
821 821
 
822 822
         ob_start();
823
-        $this->the_widget_form( 'geodir_advance_search_widget' );
823
+        $this->the_widget_form('geodir_advance_search_widget');
824 824
         $output = ob_get_contents();
825 825
         ob_end_clean();
826 826
         $this->assertContains('This is a search widget', $output);
@@ -834,17 +834,17 @@  discard block
 block discarded – undo
834 834
 
835 835
     public function testListingMapWidget() {
836 836
 
837
-        $template = geodir_plugin_path() . '/geodirectory-widgets/listing_map_widget.php';
837
+        $template = geodir_plugin_path().'/geodirectory-widgets/listing_map_widget.php';
838 838
         include_once($template);
839 839
 
840 840
         //listing page
841
-        $this->go_to( home_url('/?post_type=gd_place') );
841
+        $this->go_to(home_url('/?post_type=gd_place'));
842 842
 
843 843
         ob_start();
844 844
         $instance = array();
845 845
         $args = array();
846 846
         $args["widget_id"] = "geodir_map_v3_listing_map-2";
847
-        the_widget( 'geodir_map_listingpage', $instance, $args );
847
+        the_widget('geodir_map_listingpage', $instance, $args);
848 848
         $output = ob_get_contents();
849 849
         ob_end_clean();
850 850
         $this->assertContains('geodir-map-listing-page', $output);
@@ -856,27 +856,27 @@  discard block
 block discarded – undo
856 856
             'posts_per_page' => 1,
857 857
         );
858 858
 
859
-        $all_posts = new WP_Query( $query_args );
859
+        $all_posts = new WP_Query($query_args);
860 860
         $post_id = null;
861
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
861
+        while ($all_posts->have_posts()) : $all_posts->the_post();
862 862
             $post_id = get_the_ID();
863 863
         endwhile;
864 864
 
865 865
         $this->assertTrue(is_int($post_id));
866 866
 
867
-        $this->go_to( get_permalink($post_id) );
867
+        $this->go_to(get_permalink($post_id));
868 868
 
869 869
         ob_start();
870 870
         $instance = array();
871 871
         $args = array();
872 872
         $args["widget_id"] = "geodir_map_v3_listing_map-2";
873
-        the_widget( 'geodir_map_listingpage', $instance, $args );
873
+        the_widget('geodir_map_listingpage', $instance, $args);
874 874
         $output = ob_get_contents();
875 875
         ob_end_clean();
876 876
         $this->assertContains('geodir-map-listing-page', $output);
877 877
 
878 878
         ob_start();
879
-        $this->the_widget_form( 'geodir_map_listingpage' );
879
+        $this->the_widget_form('geodir_map_listingpage');
880 880
         $output = ob_get_contents();
881 881
         ob_end_clean();
882 882
         $this->assertContains('Select Map View', $output);
@@ -891,31 +891,31 @@  discard block
 block discarded – undo
891 891
             'scrollwheel' => '0',
892 892
             'showall' => '0'
893 893
         );
894
-        $output = $this->the_widget_form_update( 'geodir_map_listingpage', $new_instance );
894
+        $output = $this->the_widget_form_update('geodir_map_listingpage', $new_instance);
895 895
         $this->assertContains('0', $output['scrollwheel']);
896 896
 
897 897
 
898 898
     }
899 899
 
900 900
     private function load_template() {
901
-        do_action( 'template_redirect' );
901
+        do_action('template_redirect');
902 902
         $template = false;
903
-        if	 ( is_404()			&& $template = get_404_template()			) :
904
-        elseif ( is_search()		 && $template = get_search_template()		 ) :
905
-        elseif ( is_front_page()	 && $template = get_front_page_template()	 ) :
906
-        elseif ( is_home()		   && $template = get_home_template()		   ) :
907
-        elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) :
908
-        elseif ( is_tax()			&& $template = get_taxonomy_template()	   ) :
909
-        elseif ( is_attachment()	 && $template = get_attachment_template()	 ) :
903
+        if (is_404() && $template = get_404_template()) :
904
+        elseif (is_search() && $template = get_search_template()) :
905
+        elseif (is_front_page() && $template = get_front_page_template()) :
906
+        elseif (is_home() && $template = get_home_template()) :
907
+        elseif (is_post_type_archive() && $template = get_post_type_archive_template()) :
908
+        elseif (is_tax() && $template = get_taxonomy_template()) :
909
+        elseif (is_attachment() && $template = get_attachment_template()) :
910 910
             remove_filter('the_content', 'prepend_attachment');
911
-        elseif ( is_single()		 && $template = get_single_template()		 ) :
912
-        elseif ( is_page()		   && $template = get_page_template()		   ) :
913
-        elseif ( is_category()	   && $template = get_category_template()	   ) :
914
-        elseif ( is_tag()			&& $template = get_tag_template()			) :
915
-        elseif ( is_author()		 && $template = get_author_template()		 ) :
916
-        elseif ( is_date()		   && $template = get_date_template()		   ) :
917
-        elseif ( is_archive()		&& $template = get_archive_template()		) :
918
-        elseif ( is_paged()		  && $template = get_paged_template()		  ) :
911
+        elseif (is_single() && $template = get_single_template()) :
912
+        elseif (is_page() && $template = get_page_template()) :
913
+        elseif (is_category() && $template = get_category_template()) :
914
+        elseif (is_tag() && $template = get_tag_template()) :
915
+        elseif (is_author() && $template = get_author_template()) :
916
+        elseif (is_date() && $template = get_date_template()) :
917
+        elseif (is_archive() && $template = get_archive_template()) :
918
+        elseif (is_paged() && $template = get_paged_template()) :
919 919
         else :
920 920
             $template = get_index_template();
921 921
         endif;
@@ -926,21 +926,21 @@  discard block
 block discarded – undo
926 926
          *
927 927
          * @param string $template The path of the template to include.
928 928
          */
929
-        if ( $template = apply_filters( 'template_include', $template ) ) {
930
-            $template_contents = file_get_contents( $template );
929
+        if ($template = apply_filters('template_include', $template)) {
930
+            $template_contents = file_get_contents($template);
931 931
             $included_header = $included_footer = false;
932
-            if ( false !== stripos( $template_contents, 'get_header();' ) ) {
933
-                do_action( 'get_header', null );
934
-                locate_template( 'header.php', true, false );
932
+            if (false !== stripos($template_contents, 'get_header();')) {
933
+                do_action('get_header', null);
934
+                locate_template('header.php', true, false);
935 935
                 $included_header = true;
936 936
             }
937
-            include( $template );
938
-            if ( false !== stripos( $template_contents, 'get_footer();' ) ) {
939
-                do_action( 'get_footer', null );
940
-                locate_template( 'footer.php', true, false );
937
+            include($template);
938
+            if (false !== stripos($template_contents, 'get_footer();')) {
939
+                do_action('get_footer', null);
940
+                locate_template('footer.php', true, false);
941 941
                 $included_footer = true;
942 942
             }
943
-            if ( $included_header && $included_footer ) {
943
+            if ($included_header && $included_footer) {
944 944
                 global $wp_scripts;
945 945
                 $wp_scripts->done = array();
946 946
             }
@@ -948,19 +948,19 @@  discard block
 block discarded – undo
948 948
         return;
949 949
     }
950 950
 
951
-    public static function setPermalinkStructure( $struc = '/%postname%/' ) {
951
+    public static function setPermalinkStructure($struc = '/%postname%/') {
952 952
         global $wp_rewrite;
953
-        $wp_rewrite->set_permalink_structure( $struc );
953
+        $wp_rewrite->set_permalink_structure($struc);
954 954
         $wp_rewrite->flush_rules();
955
-        update_option( 'permalink_structure', $struc );
956
-        flush_rewrite_rules( true );
955
+        update_option('permalink_structure', $struc);
956
+        flush_rewrite_rules(true);
957 957
     }
958 958
 
959
-    function the_widget_form( $widget, $instance = array() ) {
959
+    function the_widget_form($widget, $instance = array()) {
960 960
         global $wp_widget_factory;
961 961
 
962 962
         $widget_obj = $wp_widget_factory->widgets[$widget];
963
-        if ( ! ( $widget_obj instanceof WP_Widget ) ) {
963
+        if (!($widget_obj instanceof WP_Widget)) {
964 964
             return;
965 965
         }
966 966
 
@@ -968,11 +968,11 @@  discard block
 block discarded – undo
968 968
         $widget_obj->form($instance);
969 969
     }
970 970
 
971
-    function the_widget_form_update( $widget, $new_instance = array(), $old_instance = array() ) {
971
+    function the_widget_form_update($widget, $new_instance = array(), $old_instance = array()) {
972 972
         global $wp_widget_factory;
973 973
 
974 974
         $widget_obj = $wp_widget_factory->widgets[$widget];
975
-        if ( ! ( $widget_obj instanceof WP_Widget ) ) {
975
+        if (!($widget_obj instanceof WP_Widget)) {
976 976
             return;
977 977
         }
978 978
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -167,8 +167,9 @@  discard block
 block discarded – undo
167 167
         $geodir_is_widget_listing = false;
168 168
 
169 169
         $GLOBALS['post'] = $current_post;
170
-        if (!empty($current_post))
171
-            setup_postdata($current_post);
170
+        if (!empty($current_post)) {
171
+                    setup_postdata($current_post);
172
+        }
172 173
         $map_jason = $current_map_jason;
173 174
         $map_canvas_arr = $current_map_canvas_arr;
174 175
 
@@ -916,8 +917,10 @@  discard block
 block discarded – undo
916 917
         elseif ( is_date()		   && $template = get_date_template()		   ) :
917 918
         elseif ( is_archive()		&& $template = get_archive_template()		) :
918 919
         elseif ( is_paged()		  && $template = get_paged_template()		  ) :
919
-        else :
920
+        else {
921
+        	:
920 922
             $template = get_index_template();
923
+        }
921 924
         endif;
922 925
         /**
923 926
          * Filter the path of the current template before including it.
Please login to merge, or discard this patch.
tests/test-Add_Custom_Fields.php 2 patches
Indentation   +280 added lines, -280 removed lines patch added patch discarded remove patch
@@ -1,309 +1,309 @@
 block discarded – undo
1 1
 <?php
2 2
 class AddCustomFields extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        wp_set_current_user(1);
8
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(1);
8
+	}
9 9
 
10
-    public function testAddCustomFields()
11
-    {
12
-        $field = array(
13
-            'listing_type'  => 'gd_place',
14
-            'data_type'     => '',
15
-            'field_type'    => 'select',
16
-            'admin_title'   => __( 'Place Type', 'test' ),
17
-            'admin_desc'    => __( 'Select the place type.', 'test' ),
18
-            'site_title'    => __( 'Place Type', 'test' ),
19
-            'htmlvar_name'  => 'test_place_type',
20
-            'default_value' => '',
21
-            'option_values' => 'Hotel,Bar,Restaurant,Pub',
22
-            'is_default'    => '1',
23
-            'is_admin'      => '1',
24
-            'clabels'       => __( 'Place Type', 'test' )
25
-        );
10
+	public function testAddCustomFields()
11
+	{
12
+		$field = array(
13
+			'listing_type'  => 'gd_place',
14
+			'data_type'     => '',
15
+			'field_type'    => 'select',
16
+			'admin_title'   => __( 'Place Type', 'test' ),
17
+			'admin_desc'    => __( 'Select the place type.', 'test' ),
18
+			'site_title'    => __( 'Place Type', 'test' ),
19
+			'htmlvar_name'  => 'test_place_type',
20
+			'default_value' => '',
21
+			'option_values' => 'Hotel,Bar,Restaurant,Pub',
22
+			'is_default'    => '1',
23
+			'is_admin'      => '1',
24
+			'clabels'       => __( 'Place Type', 'test' )
25
+		);
26 26
 
27
-        $lastid = geodir_custom_field_save( $field );
27
+		$lastid = geodir_custom_field_save( $field );
28 28
 
29
-        $this->assertTrue(is_int($lastid));
29
+		$this->assertTrue(is_int($lastid));
30 30
 
31 31
 
32
-        $field2 = array(
33
-            'listing_type'  => 'gd_place',
34
-            'data_type'     => 'VARCHAR',
35
-            'field_type'    => 'url',
36
-            'admin_title'   => __( 'Website Link', 'test' ),
37
-            'admin_desc'    => __( 'Enter the website link.', 'test' ),
38
-            'site_title'    => __( 'Website Link', 'test' ),
39
-            'htmlvar_name'  => 'test_ws_link',
40
-            'default_value' => '',
41
-            'option_values' => '',
42
-            'is_default'    => '1',
43
-            'is_admin'      => '1',
44
-            'clabels'       => __( 'Website Link', 'test' )
45
-        );
32
+		$field2 = array(
33
+			'listing_type'  => 'gd_place',
34
+			'data_type'     => 'VARCHAR',
35
+			'field_type'    => 'url',
36
+			'admin_title'   => __( 'Website Link', 'test' ),
37
+			'admin_desc'    => __( 'Enter the website link.', 'test' ),
38
+			'site_title'    => __( 'Website Link', 'test' ),
39
+			'htmlvar_name'  => 'test_ws_link',
40
+			'default_value' => '',
41
+			'option_values' => '',
42
+			'is_default'    => '1',
43
+			'is_admin'      => '1',
44
+			'clabels'       => __( 'Website Link', 'test' )
45
+		);
46 46
 
47
-        $lastid2 = geodir_custom_field_save( $field2 );
47
+		$lastid2 = geodir_custom_field_save( $field2 );
48 48
 
49
-        $this->assertTrue(is_int($lastid2));
49
+		$this->assertTrue(is_int($lastid2));
50 50
 
51
-        //test error
52
-        $field3 = array(
53
-            'listing_type'  => 'gd_place',
54
-            'data_type'     => '',
55
-            'field_type'    => 'select',
56
-            'admin_title'   => __( 'Place Type', 'test' ),
57
-            'admin_desc'    => __( 'Select the place type.', 'test' ),
58
-            'site_title'    => __( 'Place Type', 'test' ),
59
-            'htmlvar_name'  => 'test_place_type',
60
-            'default_value' => '',
61
-            'option_values' => 'Hotel,Bar,Restaurant,Pub',
62
-            'is_default'    => '1',
63
-            'is_admin'      => '1',
64
-            'clabels'       => __( 'Place Type', 'test' )
65
-        );
51
+		//test error
52
+		$field3 = array(
53
+			'listing_type'  => 'gd_place',
54
+			'data_type'     => '',
55
+			'field_type'    => 'select',
56
+			'admin_title'   => __( 'Place Type', 'test' ),
57
+			'admin_desc'    => __( 'Select the place type.', 'test' ),
58
+			'site_title'    => __( 'Place Type', 'test' ),
59
+			'htmlvar_name'  => 'test_place_type',
60
+			'default_value' => '',
61
+			'option_values' => 'Hotel,Bar,Restaurant,Pub',
62
+			'is_default'    => '1',
63
+			'is_admin'      => '1',
64
+			'clabels'       => __( 'Place Type', 'test' )
65
+		);
66 66
 
67
-        $error = geodir_custom_field_save( $field3 );
67
+		$error = geodir_custom_field_save( $field3 );
68 68
 
69
-        $this->assertContains( 'HTML Variable Name should be a unique name', $error );
70
-    }
69
+		$this->assertContains( 'HTML Variable Name should be a unique name', $error );
70
+	}
71 71
 
72
-    public function testAddMoreCustomFields() {
73
-        $fieldsets  = array();
74
-        $fields  = array();
75
-        $filters = array();
72
+	public function testAddMoreCustomFields() {
73
+		$fieldsets  = array();
74
+		$fields  = array();
75
+		$filters = array();
76 76
 
77
-        // Place Details
78
-        $fieldsets[] = array(
79
-            'listing_type'  => 'gd_place',
80
-            'data_type'     => '',
81
-            'field_type'    => 'fieldset',
82
-            'admin_title'   => __( 'Place Details', 'directory_starter' ),
83
-            'admin_desc'    => __( 'Place Details.', 'directory_starter' ),
84
-            'site_title'    => __( 'Place Details', 'directory_starter' ),
85
-            'default_value' => '',
86
-            'option_values' => '',
87
-            'is_default'    => '1',
88
-            'is_admin'      => '1',
89
-            'clabels'       => __( 'Place Details', 'directory_starter' )
90
-        );
77
+		// Place Details
78
+		$fieldsets[] = array(
79
+			'listing_type'  => 'gd_place',
80
+			'data_type'     => '',
81
+			'field_type'    => 'fieldset',
82
+			'admin_title'   => __( 'Place Details', 'directory_starter' ),
83
+			'admin_desc'    => __( 'Place Details.', 'directory_starter' ),
84
+			'site_title'    => __( 'Place Details', 'directory_starter' ),
85
+			'default_value' => '',
86
+			'option_values' => '',
87
+			'is_default'    => '1',
88
+			'is_admin'      => '1',
89
+			'clabels'       => __( 'Place Details', 'directory_starter' )
90
+		);
91 91
 
92
-        // Salary
93
-        $fields[] = array(
94
-            'listing_type' => 'gd_place',
95
-            'data_type' => 'INT',
96
-            'field_type' => 'text',
97
-            'admin_title' => __('Salary', 'directory_starter'),
98
-            'admin_desc' => __('Enter salary.', 'directory_starter'),
99
-            'site_title' => __('Salary', 'directory_starter'),
100
-            'htmlvar_name' => 'job_salary',
101
-            'default_value' => '',
102
-            'option_values' => '',
103
-            'is_default' => '1',
104
-            'is_admin' => '1',
105
-            'clabels' => __('Salary', 'directory_starter')
106
-        );
92
+		// Salary
93
+		$fields[] = array(
94
+			'listing_type' => 'gd_place',
95
+			'data_type' => 'INT',
96
+			'field_type' => 'text',
97
+			'admin_title' => __('Salary', 'directory_starter'),
98
+			'admin_desc' => __('Enter salary.', 'directory_starter'),
99
+			'site_title' => __('Salary', 'directory_starter'),
100
+			'htmlvar_name' => 'job_salary',
101
+			'default_value' => '',
102
+			'option_values' => '',
103
+			'is_default' => '1',
104
+			'is_admin' => '1',
105
+			'clabels' => __('Salary', 'directory_starter')
106
+		);
107 107
 
108
-        // Salary Filter
109
-        $filters[] = array(
110
-            'create_field' => 'true',
111
-            'listing_type' => 'gd_place',
112
-            'field_id' => '',
113
-            'field_type' => 'text',
114
-            'data_type' => 'RANGE',
115
-            'is_active' => '1',
116
-            'site_field_title' => 'Salary',
117
-            'field_data_type' => 'INT',
118
-            'data_type_change' => 'TEXT',
119
-            'search_condition_select' => 'FROM',
120
-            'search_min_value' => '',
121
-            'search_max_value' => '',
122
-            'search_diff_value' => '',
123
-            'first_search_value' => '',
124
-            'first_search_text' => '',
125
-            'last_search_text' => '',
126
-            'search_condition' => 'FROM',
127
-            'site_htmlvar_name' => 'geodir_job_salary',
128
-            'field_title' => 'geodir_job_salary',
129
-            'expand_custom_value' => '',
130
-            'front_search_title' => 'Salary',
131
-            'field_desc' => ''
132
-        );
108
+		// Salary Filter
109
+		$filters[] = array(
110
+			'create_field' => 'true',
111
+			'listing_type' => 'gd_place',
112
+			'field_id' => '',
113
+			'field_type' => 'text',
114
+			'data_type' => 'RANGE',
115
+			'is_active' => '1',
116
+			'site_field_title' => 'Salary',
117
+			'field_data_type' => 'INT',
118
+			'data_type_change' => 'TEXT',
119
+			'search_condition_select' => 'FROM',
120
+			'search_min_value' => '',
121
+			'search_max_value' => '',
122
+			'search_diff_value' => '',
123
+			'first_search_value' => '',
124
+			'first_search_text' => '',
125
+			'last_search_text' => '',
126
+			'search_condition' => 'FROM',
127
+			'site_htmlvar_name' => 'geodir_job_salary',
128
+			'field_title' => 'geodir_job_salary',
129
+			'expand_custom_value' => '',
130
+			'front_search_title' => 'Salary',
131
+			'field_desc' => ''
132
+		);
133 133
 
134
-        // Field Set
135
-        if (!empty($fieldsets)) {
136
-            foreach ($fieldsets as $fieldset_index => $fieldset) {
137
-                geodir_custom_field_save($fieldset);
138
-            }
139
-        }
134
+		// Field Set
135
+		if (!empty($fieldsets)) {
136
+			foreach ($fieldsets as $fieldset_index => $fieldset) {
137
+				geodir_custom_field_save($fieldset);
138
+			}
139
+		}
140 140
 
141
-        // Custom Fields
142
-        if (!empty($fields)) {
143
-            foreach ($fields as $field_index => $field) {
144
-                $lastid = geodir_custom_field_save( $field );
145
-                $this->assertTrue(is_int($lastid));
146
-            }
147
-        }
141
+		// Custom Fields
142
+		if (!empty($fields)) {
143
+			foreach ($fields as $field_index => $field) {
144
+				$lastid = geodir_custom_field_save( $field );
145
+				$this->assertTrue(is_int($lastid));
146
+			}
147
+		}
148 148
 
149
-    }
149
+	}
150 150
 
151
-    public function testTextCusField() {
152
-        $_REQUEST = array (
153
-            'action' =>  'geodir_ajax_action',
154
-            'create_field' =>  'true',
155
-            'field_ins_upd' =>  'submit',
156
-            '_wpnonce' =>  wp_create_nonce('custom_fields_text_field_99'),
157
-            'listing_type' =>  'gd_place',
158
-            'field_type' =>  'text',
159
-            'field_id' =>  'text_field_99',
160
-            'data_type' =>  'XVARCHAR',
161
-            'is_active' =>  '1',
162
-            'site_title' => "Text Field",
163
-            'admin_title' => "Text Field",
164
-            'admin_desc' => "Text Field",
165
-            'site_field_title' =>  'Category',
166
-            'field_data_type' =>  'VARCHAR',
167
-            'search_condition' =>  'SINGLE',
168
-            'htmlvar_name' =>  'text_field_99',
169
-            'for_admin_use' => '0',
170
-            'is_required' => '0',
171
-            'required_msg'=> '',
172
-            'validation_pattern' => '',
173
-            'validation_msg' => '',
174
-            'decimal_point' => '',
175
-            'clabels' => 'Text Field',
176
-            'is_default' => '1',
177
-            'field_title' =>  'Text Field',
178
-            'expand_custom_value' =>  '',
179
-            'search_operator' =>  'AND',
180
-            'front_search_title' =>  'Category',
181
-            'field_desc' =>  'Cat',
182
-            'geodir_ajax' => 'admin_ajax',
183
-            'manage_field_type' => 'custom_fields',
184
-            'default_value' =>  '' ,
185
-            'sort_order' =>  '11' ,
186
-            'show_on_listing' =>  '1' ,
187
-            'show_on_detail' =>  '1' ,
188
-            'show_as_tab' =>  '0' ,
189
-            'field_icon' =>  '' ,
190
-            'css_class' =>  '' ,
191
-        );
192
-        add_filter('wp_redirect', '__return_false');
193
-        ob_start();
194
-        geodir_ajax_handler();
195
-        $output = ob_get_contents();
196
-        ob_end_clean();
197
-        $this->assertContains('Double Click to toggle', $output);
198
-        remove_filter('wp_redirect', '__return_false');
151
+	public function testTextCusField() {
152
+		$_REQUEST = array (
153
+			'action' =>  'geodir_ajax_action',
154
+			'create_field' =>  'true',
155
+			'field_ins_upd' =>  'submit',
156
+			'_wpnonce' =>  wp_create_nonce('custom_fields_text_field_99'),
157
+			'listing_type' =>  'gd_place',
158
+			'field_type' =>  'text',
159
+			'field_id' =>  'text_field_99',
160
+			'data_type' =>  'XVARCHAR',
161
+			'is_active' =>  '1',
162
+			'site_title' => "Text Field",
163
+			'admin_title' => "Text Field",
164
+			'admin_desc' => "Text Field",
165
+			'site_field_title' =>  'Category',
166
+			'field_data_type' =>  'VARCHAR',
167
+			'search_condition' =>  'SINGLE',
168
+			'htmlvar_name' =>  'text_field_99',
169
+			'for_admin_use' => '0',
170
+			'is_required' => '0',
171
+			'required_msg'=> '',
172
+			'validation_pattern' => '',
173
+			'validation_msg' => '',
174
+			'decimal_point' => '',
175
+			'clabels' => 'Text Field',
176
+			'is_default' => '1',
177
+			'field_title' =>  'Text Field',
178
+			'expand_custom_value' =>  '',
179
+			'search_operator' =>  'AND',
180
+			'front_search_title' =>  'Category',
181
+			'field_desc' =>  'Cat',
182
+			'geodir_ajax' => 'admin_ajax',
183
+			'manage_field_type' => 'custom_fields',
184
+			'default_value' =>  '' ,
185
+			'sort_order' =>  '11' ,
186
+			'show_on_listing' =>  '1' ,
187
+			'show_on_detail' =>  '1' ,
188
+			'show_as_tab' =>  '0' ,
189
+			'field_icon' =>  '' ,
190
+			'css_class' =>  '' ,
191
+		);
192
+		add_filter('wp_redirect', '__return_false');
193
+		ob_start();
194
+		geodir_ajax_handler();
195
+		$output = ob_get_contents();
196
+		ob_end_clean();
197
+		$this->assertContains('Double Click to toggle', $output);
198
+		remove_filter('wp_redirect', '__return_false');
199 199
 
200
-    }
200
+	}
201 201
 
202
-    public function texstDateCusField() {
203
-        $_REQUEST = array (
204
-            'action' =>  'geodir_ajax_action',
205
-            'create_field' =>  'true',
206
-            'field_ins_upd' =>  'submit',
207
-            '_wpnonce' =>  wp_create_nonce('custom_fields_date_field'),
208
-            'listing_type' =>  'gd_place',
209
-            'field_type' =>  'datepicker',
210
-            'field_id' =>  'date_field',
211
-            'data_type' =>  '',
212
-            'is_active' =>  '1',
213
-            'site_title' => "Text Field",
214
-            'admin_title' => "Text Field",
215
-            'admin_desc' => "Text Field",
216
-            'site_field_title' =>  'Category',
217
-            'field_data_type' =>  'VARCHAR',
218
-            'search_condition' =>  'SINGLE',
219
-            'htmlvar_name' =>  'date_field',
220
-            'for_admin_use' => '0',
221
-            'is_required' => '0',
222
-            'required_msg'=> '',
223
-            'validation_pattern' => '',
224
-            'validation_msg' => '',
225
-            'decimal_point' => '',
226
-            'clabels' => 'Text Field',
227
-            'is_default' => '0',
228
-            'field_title' =>  'Text Field',
229
-            'expand_custom_value' =>  '',
230
-            'search_operator' =>  'AND',
231
-            'front_search_title' =>  'Category',
232
-            'field_desc' =>  'Cat',
233
-            'geodir_ajax' => 'admin_ajax',
234
-            'manage_field_type' => 'custom_fields',
235
-            'default_value' =>  '' ,
236
-            'sort_order' =>  '12' ,
237
-            'show_on_listing' =>  '1' ,
238
-            'show_on_detail' =>  '1' ,
239
-            'show_as_tab' =>  '0' ,
240
-            'field_icon' =>  '' ,
241
-            'css_class' =>  '' ,
242
-            'extra' => array(
243
-                'date_format' => 'mm/dd/yy'
244
-            )
245
-        );
246
-        add_filter('wp_redirect', '__return_false');
247
-        ob_start();
248
-        geodir_ajax_handler();
249
-        $output = ob_get_contents();
250
-        ob_end_clean();
251
-        $this->assertContains('Double Click to toggle', $output);
252
-        remove_filter('wp_redirect', '__return_false');
202
+	public function texstDateCusField() {
203
+		$_REQUEST = array (
204
+			'action' =>  'geodir_ajax_action',
205
+			'create_field' =>  'true',
206
+			'field_ins_upd' =>  'submit',
207
+			'_wpnonce' =>  wp_create_nonce('custom_fields_date_field'),
208
+			'listing_type' =>  'gd_place',
209
+			'field_type' =>  'datepicker',
210
+			'field_id' =>  'date_field',
211
+			'data_type' =>  '',
212
+			'is_active' =>  '1',
213
+			'site_title' => "Text Field",
214
+			'admin_title' => "Text Field",
215
+			'admin_desc' => "Text Field",
216
+			'site_field_title' =>  'Category',
217
+			'field_data_type' =>  'VARCHAR',
218
+			'search_condition' =>  'SINGLE',
219
+			'htmlvar_name' =>  'date_field',
220
+			'for_admin_use' => '0',
221
+			'is_required' => '0',
222
+			'required_msg'=> '',
223
+			'validation_pattern' => '',
224
+			'validation_msg' => '',
225
+			'decimal_point' => '',
226
+			'clabels' => 'Text Field',
227
+			'is_default' => '0',
228
+			'field_title' =>  'Text Field',
229
+			'expand_custom_value' =>  '',
230
+			'search_operator' =>  'AND',
231
+			'front_search_title' =>  'Category',
232
+			'field_desc' =>  'Cat',
233
+			'geodir_ajax' => 'admin_ajax',
234
+			'manage_field_type' => 'custom_fields',
235
+			'default_value' =>  '' ,
236
+			'sort_order' =>  '12' ,
237
+			'show_on_listing' =>  '1' ,
238
+			'show_on_detail' =>  '1' ,
239
+			'show_as_tab' =>  '0' ,
240
+			'field_icon' =>  '' ,
241
+			'css_class' =>  '' ,
242
+			'extra' => array(
243
+				'date_format' => 'mm/dd/yy'
244
+			)
245
+		);
246
+		add_filter('wp_redirect', '__return_false');
247
+		ob_start();
248
+		geodir_ajax_handler();
249
+		$output = ob_get_contents();
250
+		ob_end_clean();
251
+		$this->assertContains('Double Click to toggle', $output);
252
+		remove_filter('wp_redirect', '__return_false');
253 253
 
254
-    }
254
+	}
255 255
 
256
-    public function texstTextAreaCusField() {
257
-        $_REQUEST = array (
258
-            'action' =>  'geodir_ajax_action',
259
-            'create_field' =>  'true',
260
-            'field_ins_upd' =>  'submit',
261
-            '_wpnonce' =>  wp_create_nonce('custom_fields_textarea_field'),
262
-            'listing_type' =>  'gd_place',
263
-            'field_type' =>  'textarea',
264
-            'field_id' =>  'textarea_field',
265
-            'data_type' =>  '',
266
-            'is_active' =>  '1',
267
-            'site_title' => "Text Field",
268
-            'admin_title' => "Text Field",
269
-            'admin_desc' => "Text Field",
270
-            'htmlvar_name' =>  'textarea_field',
271
-            'for_admin_use' => '0',
272
-            'is_required' => '0',
273
-            'required_msg'=> '',
274
-            'validation_pattern' => '',
275
-            'validation_msg' => '',
276
-            'decimal_point' => '',
277
-            'clabels' => 'Text Field',
278
-            'is_default' => '1',
279
-            'field_title' =>  'Text Field',
280
-            'expand_custom_value' =>  '',
281
-            'search_operator' =>  'AND',
282
-            'front_search_title' =>  'Category',
283
-            'field_desc' =>  'Cat',
284
-            'geodir_ajax' => 'admin_ajax',
285
-            'manage_field_type' => 'custom_fields',
286
-            'default_value' =>  '' ,
287
-            'sort_order' =>  '12' ,
288
-            'show_on_listing' =>  '1' ,
289
-            'show_on_detail' =>  '1' ,
290
-            'show_as_tab' =>  '0' ,
291
-            'field_icon' =>  '' ,
292
-            'css_class' =>  '' ,
293
-        );
294
-        add_filter('wp_redirect', '__return_false');
295
-        ob_start();
296
-        geodir_ajax_handler();
297
-        $output = ob_get_contents();
298
-        ob_end_clean();
299
-        $this->assertContains('Double Click to toggle', $output);
300
-        remove_filter('wp_redirect', '__return_false');
256
+	public function texstTextAreaCusField() {
257
+		$_REQUEST = array (
258
+			'action' =>  'geodir_ajax_action',
259
+			'create_field' =>  'true',
260
+			'field_ins_upd' =>  'submit',
261
+			'_wpnonce' =>  wp_create_nonce('custom_fields_textarea_field'),
262
+			'listing_type' =>  'gd_place',
263
+			'field_type' =>  'textarea',
264
+			'field_id' =>  'textarea_field',
265
+			'data_type' =>  '',
266
+			'is_active' =>  '1',
267
+			'site_title' => "Text Field",
268
+			'admin_title' => "Text Field",
269
+			'admin_desc' => "Text Field",
270
+			'htmlvar_name' =>  'textarea_field',
271
+			'for_admin_use' => '0',
272
+			'is_required' => '0',
273
+			'required_msg'=> '',
274
+			'validation_pattern' => '',
275
+			'validation_msg' => '',
276
+			'decimal_point' => '',
277
+			'clabels' => 'Text Field',
278
+			'is_default' => '1',
279
+			'field_title' =>  'Text Field',
280
+			'expand_custom_value' =>  '',
281
+			'search_operator' =>  'AND',
282
+			'front_search_title' =>  'Category',
283
+			'field_desc' =>  'Cat',
284
+			'geodir_ajax' => 'admin_ajax',
285
+			'manage_field_type' => 'custom_fields',
286
+			'default_value' =>  '' ,
287
+			'sort_order' =>  '12' ,
288
+			'show_on_listing' =>  '1' ,
289
+			'show_on_detail' =>  '1' ,
290
+			'show_as_tab' =>  '0' ,
291
+			'field_icon' =>  '' ,
292
+			'css_class' =>  '' ,
293
+		);
294
+		add_filter('wp_redirect', '__return_false');
295
+		ob_start();
296
+		geodir_ajax_handler();
297
+		$output = ob_get_contents();
298
+		ob_end_clean();
299
+		$this->assertContains('Double Click to toggle', $output);
300
+		remove_filter('wp_redirect', '__return_false');
301 301
 
302
-    }
302
+	}
303 303
 
304
-    public function tearDown()
305
-    {
306
-        parent::tearDown();
307
-    }
304
+	public function tearDown()
305
+	{
306
+		parent::tearDown();
307
+	}
308 308
 }
309 309
 ?>
310 310
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -13,18 +13,18 @@  discard block
 block discarded – undo
13 13
             'listing_type'  => 'gd_place',
14 14
             'data_type'     => '',
15 15
             'field_type'    => 'select',
16
-            'admin_title'   => __( 'Place Type', 'test' ),
17
-            'admin_desc'    => __( 'Select the place type.', 'test' ),
18
-            'site_title'    => __( 'Place Type', 'test' ),
16
+            'admin_title'   => __('Place Type', 'test'),
17
+            'admin_desc'    => __('Select the place type.', 'test'),
18
+            'site_title'    => __('Place Type', 'test'),
19 19
             'htmlvar_name'  => 'test_place_type',
20 20
             'default_value' => '',
21 21
             'option_values' => 'Hotel,Bar,Restaurant,Pub',
22 22
             'is_default'    => '1',
23 23
             'is_admin'      => '1',
24
-            'clabels'       => __( 'Place Type', 'test' )
24
+            'clabels'       => __('Place Type', 'test')
25 25
         );
26 26
 
27
-        $lastid = geodir_custom_field_save( $field );
27
+        $lastid = geodir_custom_field_save($field);
28 28
 
29 29
         $this->assertTrue(is_int($lastid));
30 30
 
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
             'listing_type'  => 'gd_place',
34 34
             'data_type'     => 'VARCHAR',
35 35
             'field_type'    => 'url',
36
-            'admin_title'   => __( 'Website Link', 'test' ),
37
-            'admin_desc'    => __( 'Enter the website link.', 'test' ),
38
-            'site_title'    => __( 'Website Link', 'test' ),
36
+            'admin_title'   => __('Website Link', 'test'),
37
+            'admin_desc'    => __('Enter the website link.', 'test'),
38
+            'site_title'    => __('Website Link', 'test'),
39 39
             'htmlvar_name'  => 'test_ws_link',
40 40
             'default_value' => '',
41 41
             'option_values' => '',
42 42
             'is_default'    => '1',
43 43
             'is_admin'      => '1',
44
-            'clabels'       => __( 'Website Link', 'test' )
44
+            'clabels'       => __('Website Link', 'test')
45 45
         );
46 46
 
47
-        $lastid2 = geodir_custom_field_save( $field2 );
47
+        $lastid2 = geodir_custom_field_save($field2);
48 48
 
49 49
         $this->assertTrue(is_int($lastid2));
50 50
 
@@ -53,24 +53,24 @@  discard block
 block discarded – undo
53 53
             'listing_type'  => 'gd_place',
54 54
             'data_type'     => '',
55 55
             'field_type'    => 'select',
56
-            'admin_title'   => __( 'Place Type', 'test' ),
57
-            'admin_desc'    => __( 'Select the place type.', 'test' ),
58
-            'site_title'    => __( 'Place Type', 'test' ),
56
+            'admin_title'   => __('Place Type', 'test'),
57
+            'admin_desc'    => __('Select the place type.', 'test'),
58
+            'site_title'    => __('Place Type', 'test'),
59 59
             'htmlvar_name'  => 'test_place_type',
60 60
             'default_value' => '',
61 61
             'option_values' => 'Hotel,Bar,Restaurant,Pub',
62 62
             'is_default'    => '1',
63 63
             'is_admin'      => '1',
64
-            'clabels'       => __( 'Place Type', 'test' )
64
+            'clabels'       => __('Place Type', 'test')
65 65
         );
66 66
 
67
-        $error = geodir_custom_field_save( $field3 );
67
+        $error = geodir_custom_field_save($field3);
68 68
 
69
-        $this->assertContains( 'HTML Variable Name should be a unique name', $error );
69
+        $this->assertContains('HTML Variable Name should be a unique name', $error);
70 70
     }
71 71
 
72 72
     public function testAddMoreCustomFields() {
73
-        $fieldsets  = array();
73
+        $fieldsets = array();
74 74
         $fields  = array();
75 75
         $filters = array();
76 76
 
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
             'listing_type'  => 'gd_place',
80 80
             'data_type'     => '',
81 81
             'field_type'    => 'fieldset',
82
-            'admin_title'   => __( 'Place Details', 'directory_starter' ),
83
-            'admin_desc'    => __( 'Place Details.', 'directory_starter' ),
84
-            'site_title'    => __( 'Place Details', 'directory_starter' ),
82
+            'admin_title'   => __('Place Details', 'directory_starter'),
83
+            'admin_desc'    => __('Place Details.', 'directory_starter'),
84
+            'site_title'    => __('Place Details', 'directory_starter'),
85 85
             'default_value' => '',
86 86
             'option_values' => '',
87 87
             'is_default'    => '1',
88 88
             'is_admin'      => '1',
89
-            'clabels'       => __( 'Place Details', 'directory_starter' )
89
+            'clabels'       => __('Place Details', 'directory_starter')
90 90
         );
91 91
 
92 92
         // Salary
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         // Custom Fields
142 142
         if (!empty($fields)) {
143 143
             foreach ($fields as $field_index => $field) {
144
-                $lastid = geodir_custom_field_save( $field );
144
+                $lastid = geodir_custom_field_save($field);
145 145
                 $this->assertTrue(is_int($lastid));
146 146
             }
147 147
         }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     }
150 150
 
151 151
     public function testTextCusField() {
152
-        $_REQUEST = array (
152
+        $_REQUEST = array(
153 153
             'action' =>  'geodir_ajax_action',
154 154
             'create_field' =>  'true',
155 155
             'field_ins_upd' =>  'submit',
@@ -181,13 +181,13 @@  discard block
 block discarded – undo
181 181
             'field_desc' =>  'Cat',
182 182
             'geodir_ajax' => 'admin_ajax',
183 183
             'manage_field_type' => 'custom_fields',
184
-            'default_value' =>  '' ,
185
-            'sort_order' =>  '11' ,
186
-            'show_on_listing' =>  '1' ,
187
-            'show_on_detail' =>  '1' ,
188
-            'show_as_tab' =>  '0' ,
189
-            'field_icon' =>  '' ,
190
-            'css_class' =>  '' ,
184
+            'default_value' =>  '',
185
+            'sort_order' =>  '11',
186
+            'show_on_listing' =>  '1',
187
+            'show_on_detail' =>  '1',
188
+            'show_as_tab' =>  '0',
189
+            'field_icon' =>  '',
190
+            'css_class' =>  '',
191 191
         );
192 192
         add_filter('wp_redirect', '__return_false');
193 193
         ob_start();
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     }
201 201
 
202 202
     public function texstDateCusField() {
203
-        $_REQUEST = array (
203
+        $_REQUEST = array(
204 204
             'action' =>  'geodir_ajax_action',
205 205
             'create_field' =>  'true',
206 206
             'field_ins_upd' =>  'submit',
@@ -232,13 +232,13 @@  discard block
 block discarded – undo
232 232
             'field_desc' =>  'Cat',
233 233
             'geodir_ajax' => 'admin_ajax',
234 234
             'manage_field_type' => 'custom_fields',
235
-            'default_value' =>  '' ,
236
-            'sort_order' =>  '12' ,
237
-            'show_on_listing' =>  '1' ,
238
-            'show_on_detail' =>  '1' ,
239
-            'show_as_tab' =>  '0' ,
240
-            'field_icon' =>  '' ,
241
-            'css_class' =>  '' ,
235
+            'default_value' =>  '',
236
+            'sort_order' =>  '12',
237
+            'show_on_listing' =>  '1',
238
+            'show_on_detail' =>  '1',
239
+            'show_as_tab' =>  '0',
240
+            'field_icon' =>  '',
241
+            'css_class' =>  '',
242 242
             'extra' => array(
243 243
                 'date_format' => 'mm/dd/yy'
244 244
             )
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     }
255 255
 
256 256
     public function texstTextAreaCusField() {
257
-        $_REQUEST = array (
257
+        $_REQUEST = array(
258 258
             'action' =>  'geodir_ajax_action',
259 259
             'create_field' =>  'true',
260 260
             'field_ins_upd' =>  'submit',
@@ -283,13 +283,13 @@  discard block
 block discarded – undo
283 283
             'field_desc' =>  'Cat',
284 284
             'geodir_ajax' => 'admin_ajax',
285 285
             'manage_field_type' => 'custom_fields',
286
-            'default_value' =>  '' ,
287
-            'sort_order' =>  '12' ,
288
-            'show_on_listing' =>  '1' ,
289
-            'show_on_detail' =>  '1' ,
290
-            'show_as_tab' =>  '0' ,
291
-            'field_icon' =>  '' ,
292
-            'css_class' =>  '' ,
286
+            'default_value' =>  '',
287
+            'sort_order' =>  '12',
288
+            'show_on_listing' =>  '1',
289
+            'show_on_detail' =>  '1',
290
+            'show_as_tab' =>  '0',
291
+            'field_icon' =>  '',
292
+            'css_class' =>  '',
293 293
         );
294 294
         add_filter('wp_redirect', '__return_false');
295 295
         ob_start();
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -3,32 +3,32 @@  discard block
 block discarded – undo
3 3
 $_SERVER['SERVER_NAME'] = '';
4 4
 $PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
5 5
 
6
-define( 'GEODIR_USE_PHP_SESSIONS', false );
7
-define( 'GD_TESTING_MODE', true );
6
+define('GEODIR_USE_PHP_SESSIONS', false);
7
+define('GD_TESTING_MODE', true);
8 8
 
9
-$_tests_dir = getenv( 'WP_TESTS_DIR' );
9
+$_tests_dir = getenv('WP_TESTS_DIR');
10 10
 
11
-$is_selenium_test = getenv( 'IS_SELENIUM_TEST' );
11
+$is_selenium_test = getenv('IS_SELENIUM_TEST');
12 12
 
13
-if ( ! $is_selenium_test ) {
13
+if (!$is_selenium_test) {
14 14
 	$is_selenium_test = false;
15 15
 } else {
16 16
 	$is_selenium_test = true;
17 17
 }
18 18
 
19
-if ( ! $_tests_dir ) {
20
-	$_tests_dir = dirname( __FILE__ )  . '/lib/wordpress-tests-lib';
19
+if (!$_tests_dir) {
20
+	$_tests_dir = dirname(__FILE__).'/lib/wordpress-tests-lib';
21 21
 }
22 22
 
23
-require_once $_tests_dir . '/includes/functions.php';
24
-require $_tests_dir . '/includes/bootstrap.php';
23
+require_once $_tests_dir.'/includes/functions.php';
24
+require $_tests_dir.'/includes/bootstrap.php';
25 25
 
26
-if ( $is_selenium_test ) {
27
-	require dirname( __FILE__ ) . '/selenium/base.php';
26
+if ($is_selenium_test) {
27
+	require dirname(__FILE__).'/selenium/base.php';
28 28
 }
29 29
 
30
-if ( ! $is_selenium_test ) {
31
-	require dirname( __FILE__ ) . '/../geodirectory.php';
30
+if (!$is_selenium_test) {
31
+	require dirname(__FILE__).'/../geodirectory.php';
32 32
 	tests_add_filter('place_dummy_image_url', 'place_dummy_image_url');
33 33
 	tests_add_filter('place_dummy_cat_image_url', 'place_dummy_cat_image_url');
34 34
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
 function test_create_dummy_posts($max = 10) {
88 88
 	$i = 1;
89
-	while($i <= $max) {
89
+	while ($i <= $max) {
90 90
 		global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
91 91
 
92 92
 		$dummy_post_index = $i;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		$city_bound_lat2 = 40.91525559999999;
96 96
 		$city_bound_lng2 = -73.7002721;
97 97
 
98
-		include dirname( __FILE__ ) . '/../geodirectory-admin/place_dummy_post.php';
98
+		include dirname(__FILE__).'/../geodirectory-admin/place_dummy_post.php';
99 99
 		$i++;
100 100
 	}
101 101
 }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 }
112 112
 
113 113
 function place_dummy_image_url($url) {
114
-	$gd_dummy_base_url = getenv( 'GD_DUMMY_BASE_URL' );
114
+	$gd_dummy_base_url = getenv('GD_DUMMY_BASE_URL');
115 115
 	if ($gd_dummy_base_url) {
116 116
 		return $gd_dummy_base_url;
117 117
 	} else {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 }
121 121
 
122 122
 function place_dummy_cat_image_url($url) {
123
-	$gd_dummy_base_url = getenv( 'GD_DUMMY_BASE_URL' );
123
+	$gd_dummy_base_url = getenv('GD_DUMMY_BASE_URL');
124 124
 	if ($gd_dummy_base_url) {
125 125
 		return $gd_dummy_base_url."/cat_icon";
126 126
 	} else {
Please login to merge, or discard this patch.
tests/test-Delete_Listing.php 2 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,38 +1,38 @@
 block discarded – undo
1 1
 <?php
2 2
 class DeleteListing extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        wp_set_current_user(1);
8
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(1);
8
+	}
9 9
 
10
-    public function testDeleteListing()
11
-    {
12
-        $query_args = array(
13
-            'post_status' => 'publish',
14
-            'post_type' => 'gd_place',
15
-            'posts_per_page' => 1,
16
-            'author' => 1
17
-        );
10
+	public function testDeleteListing()
11
+	{
12
+		$query_args = array(
13
+			'post_status' => 'publish',
14
+			'post_type' => 'gd_place',
15
+			'posts_per_page' => 1,
16
+			'author' => 1
17
+		);
18 18
 
19
-        $all_posts = new WP_Query( $query_args );
20
-        $post_id = null;
21
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
22
-            $post_id = get_the_ID();
23
-        endwhile;
19
+		$all_posts = new WP_Query( $query_args );
20
+		$post_id = null;
21
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
22
+			$post_id = get_the_ID();
23
+		endwhile;
24 24
 
25
-        $this->assertTrue(is_int($post_id));
25
+		$this->assertTrue(is_int($post_id));
26 26
 
27
-        $lastid = wp_delete_post($post_id);
27
+		$lastid = wp_delete_post($post_id);
28 28
 
29
-        $this->assertTrue(is_int($lastid->ID));
29
+		$this->assertTrue(is_int($lastid->ID));
30 30
 
31
-    }
31
+	}
32 32
 
33
-    public function tearDown()
34
-    {
35
-        parent::tearDown();
36
-    }
33
+	public function tearDown()
34
+	{
35
+		parent::tearDown();
36
+	}
37 37
 }
38 38
 ?>
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@
 block discarded – undo
15 15
             'posts_per_page' => 1,
16 16
         );
17 17
 
18
-        $all_posts = new WP_Query( $query_args );
18
+        $all_posts = new WP_Query($query_args);
19 19
         $post_id = null;
20
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
20
+        while ($all_posts->have_posts()) : $all_posts->the_post();
21 21
             $post_id = get_the_ID();
22 22
         endwhile;
23 23
 
Please login to merge, or discard this patch.
tests/test-GDAjaxTests.php 2 patches
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -1,101 +1,101 @@
 block discarded – undo
1 1
 <?php
2 2
 class GDAjaxTests extends WP_Ajax_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        wp_set_current_user(1);
8
-    }
9
-
10
-    public function testBestOfWidgetAjax() {
11
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php';
12
-        include_once($template);
13
-
14
-        $time = current_time('mysql');
15
-
16
-        $query_args = array(
17
-            'post_status' => 'publish',
18
-            'post_type' => 'gd_place',
19
-            'posts_per_page' => 1,
20
-        );
21
-
22
-        $all_posts = new WP_Query( $query_args );
23
-        $post_id = null;
24
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
25
-            $post_id = get_the_ID();
26
-        endwhile;
27
-
28
-        $this->assertTrue(is_int($post_id));
29
-
30
-        $data = array(
31
-            'comment_post_ID' => $post_id,
32
-            'comment_author' => 'admin',
33
-            'comment_author_email' => '[email protected]',
34
-            'comment_author_url' => 'http://wpgeodirectory.com',
35
-            'comment_content' => 'content here',
36
-            'comment_type' => '',
37
-            'comment_parent' => 0,
38
-            'user_id' => 1,
39
-            'comment_author_IP' => '127.0.0.1',
40
-            'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)',
41
-            'comment_date' => $time,
42
-            'comment_approved' => 1,
43
-        );
44
-
45
-        $comment_id = wp_insert_comment($data);
46
-
47
-        $_REQUEST['geodir_overallrating'] = 5.0;
48
-        geodir_save_rating($comment_id);
49
-
50
-        $this->assertTrue(is_int($comment_id));
51
-
52
-        //ajax function test
53
-        $ajax_nonce = wp_create_nonce("geodir-bestof-nonce");
54
-
55
-        $terms = get_terms( array(
56
-            'taxonomy' => 'gd_placecategory',
57
-            'hide_empty' => false,
58
-        ) );
59
-        $term_id = $terms[0]->term_id;
60
-
61
-        $_POST['post_type'] = 'gd_place';
62
-        $_POST['post_limit'] = '5';
63
-        $_POST['char_count'] = '20';
64
-        $_POST['taxonomy'] = 'gd_placecategory';
65
-        $_POST['add_location_filter'] = '1';
66
-        $_POST['term_id'] = (string) $term_id;
67
-        $_POST['excerpt_type'] = 'show-reviews';
68
-        $_POST['geodir_bestof_nonce'] = $ajax_nonce;
69
-
70
-        $this->_handleAjax('geodir_bestof');
71
-        $this->assertContains("bestof-cat-title", $this->_last_response);
72
-
73
-
74
-    }
75
-
76
-    public function texstImportExport() {
77
-        $nonce = wp_create_nonce( 'geodir_import_export_nonce' );
78
-
79
-        $_POST['_nonce'] = $nonce;
80
-        $_POST['_pt'] = 'gd_place';
81
-        $_POST['task'] = 'export_posts';
82
-        $_POST['_n'] = 5000;
83
-        $_POST['_p'] = 1;
84
-
85
-        $this->_handleAjax('geodir_import_export');
86
-        try {
87
-            $this->assertContains("bestof-cat-title", $this->_last_response);
88
-        } catch (WPAjaxDieStopException $e) {
89
-            var_dump("WPAjaxDieStopException: " . $e );
90
-        } catch (WPAjaxDieContinueException $e) {
91
-            var_dump("WPAjaxDieContinueException: " . $e );
92
-        }
93
-
94
-    }
95
-
96
-    public function tearDown()
97
-    {
98
-        parent::tearDown();
99
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(1);
8
+	}
9
+
10
+	public function testBestOfWidgetAjax() {
11
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php';
12
+		include_once($template);
13
+
14
+		$time = current_time('mysql');
15
+
16
+		$query_args = array(
17
+			'post_status' => 'publish',
18
+			'post_type' => 'gd_place',
19
+			'posts_per_page' => 1,
20
+		);
21
+
22
+		$all_posts = new WP_Query( $query_args );
23
+		$post_id = null;
24
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
25
+			$post_id = get_the_ID();
26
+		endwhile;
27
+
28
+		$this->assertTrue(is_int($post_id));
29
+
30
+		$data = array(
31
+			'comment_post_ID' => $post_id,
32
+			'comment_author' => 'admin',
33
+			'comment_author_email' => '[email protected]',
34
+			'comment_author_url' => 'http://wpgeodirectory.com',
35
+			'comment_content' => 'content here',
36
+			'comment_type' => '',
37
+			'comment_parent' => 0,
38
+			'user_id' => 1,
39
+			'comment_author_IP' => '127.0.0.1',
40
+			'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)',
41
+			'comment_date' => $time,
42
+			'comment_approved' => 1,
43
+		);
44
+
45
+		$comment_id = wp_insert_comment($data);
46
+
47
+		$_REQUEST['geodir_overallrating'] = 5.0;
48
+		geodir_save_rating($comment_id);
49
+
50
+		$this->assertTrue(is_int($comment_id));
51
+
52
+		//ajax function test
53
+		$ajax_nonce = wp_create_nonce("geodir-bestof-nonce");
54
+
55
+		$terms = get_terms( array(
56
+			'taxonomy' => 'gd_placecategory',
57
+			'hide_empty' => false,
58
+		) );
59
+		$term_id = $terms[0]->term_id;
60
+
61
+		$_POST['post_type'] = 'gd_place';
62
+		$_POST['post_limit'] = '5';
63
+		$_POST['char_count'] = '20';
64
+		$_POST['taxonomy'] = 'gd_placecategory';
65
+		$_POST['add_location_filter'] = '1';
66
+		$_POST['term_id'] = (string) $term_id;
67
+		$_POST['excerpt_type'] = 'show-reviews';
68
+		$_POST['geodir_bestof_nonce'] = $ajax_nonce;
69
+
70
+		$this->_handleAjax('geodir_bestof');
71
+		$this->assertContains("bestof-cat-title", $this->_last_response);
72
+
73
+
74
+	}
75
+
76
+	public function texstImportExport() {
77
+		$nonce = wp_create_nonce( 'geodir_import_export_nonce' );
78
+
79
+		$_POST['_nonce'] = $nonce;
80
+		$_POST['_pt'] = 'gd_place';
81
+		$_POST['task'] = 'export_posts';
82
+		$_POST['_n'] = 5000;
83
+		$_POST['_p'] = 1;
84
+
85
+		$this->_handleAjax('geodir_import_export');
86
+		try {
87
+			$this->assertContains("bestof-cat-title", $this->_last_response);
88
+		} catch (WPAjaxDieStopException $e) {
89
+			var_dump("WPAjaxDieStopException: " . $e );
90
+		} catch (WPAjaxDieContinueException $e) {
91
+			var_dump("WPAjaxDieContinueException: " . $e );
92
+		}
93
+
94
+	}
95
+
96
+	public function tearDown()
97
+	{
98
+		parent::tearDown();
99
+	}
100 100
 }
101 101
 ?>
102 102
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
     }
9 9
 
10 10
     public function testBestOfWidgetAjax() {
11
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php';
11
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_bestof_widget.php';
12 12
         include_once($template);
13 13
 
14 14
         $time = current_time('mysql');
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
             'posts_per_page' => 1,
20 20
         );
21 21
 
22
-        $all_posts = new WP_Query( $query_args );
22
+        $all_posts = new WP_Query($query_args);
23 23
         $post_id = null;
24
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
24
+        while ($all_posts->have_posts()) : $all_posts->the_post();
25 25
             $post_id = get_the_ID();
26 26
         endwhile;
27 27
 
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
         //ajax function test
53 53
         $ajax_nonce = wp_create_nonce("geodir-bestof-nonce");
54 54
 
55
-        $terms = get_terms( array(
55
+        $terms = get_terms(array(
56 56
             'taxonomy' => 'gd_placecategory',
57 57
             'hide_empty' => false,
58
-        ) );
58
+        ));
59 59
         $term_id = $terms[0]->term_id;
60 60
 
61 61
         $_POST['post_type'] = 'gd_place';
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     }
75 75
 
76 76
     public function texstImportExport() {
77
-        $nonce = wp_create_nonce( 'geodir_import_export_nonce' );
77
+        $nonce = wp_create_nonce('geodir_import_export_nonce');
78 78
 
79 79
         $_POST['_nonce'] = $nonce;
80 80
         $_POST['_pt'] = 'gd_place';
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
         try {
87 87
             $this->assertContains("bestof-cat-title", $this->_last_response);
88 88
         } catch (WPAjaxDieStopException $e) {
89
-            var_dump("WPAjaxDieStopException: " . $e );
89
+            var_dump("WPAjaxDieStopException: ".$e);
90 90
         } catch (WPAjaxDieContinueException $e) {
91
-            var_dump("WPAjaxDieContinueException: " . $e );
91
+            var_dump("WPAjaxDieContinueException: ".$e);
92 92
         }
93 93
 
94 94
     }
Please login to merge, or discard this patch.
tests/test-User.php 2 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -1,68 +1,68 @@
 block discarded – undo
1 1
 <?php
2 2
 class UserTest extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        wp_set_current_user(1);
8
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(1);
8
+	}
9 9
 
10
-    public function testDisplayUserFavorites() {
10
+	public function testDisplayUserFavorites() {
11 11
 
12
-        global $current_user;
12
+		global $current_user;
13 13
 
14
-        $user_id = $current_user->ID;
14
+		$user_id = $current_user->ID;
15 15
 
16
-        $query_args = array(
17
-            'post_status' => 'publish',
18
-            'post_type' => 'gd_place',
19
-            'posts_per_page' => 1,
20
-        );
16
+		$query_args = array(
17
+			'post_status' => 'publish',
18
+			'post_type' => 'gd_place',
19
+			'posts_per_page' => 1,
20
+		);
21 21
 
22
-        $all_posts = new WP_Query( $query_args );
23
-        $post_id = null;
24
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
25
-            $post_id = get_the_ID();
26
-        endwhile;
22
+		$all_posts = new WP_Query( $query_args );
23
+		$post_id = null;
24
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
25
+			$post_id = get_the_ID();
26
+		endwhile;
27 27
 
28
-        $this->assertTrue(is_int($post_id));
28
+		$this->assertTrue(is_int($post_id));
29 29
 
30
-        ob_start();
31
-        geodir_add_to_favorite($post_id);
32
-        $output = ob_get_contents();
33
-        ob_end_clean();
34
-        $this->assertContains( 'Remove from Favorites', $output );
30
+		ob_start();
31
+		geodir_add_to_favorite($post_id);
32
+		$output = ob_get_contents();
33
+		ob_end_clean();
34
+		$this->assertContains( 'Remove from Favorites', $output );
35 35
 
36 36
 
37
-        $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
37
+		$user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
38 38
 
39
-        $this->assertContains( $post_id, $user_fav_posts );
39
+		$this->assertContains( $post_id, $user_fav_posts );
40 40
 
41
-        ob_start();
42
-        geodir_user_show_favourites($user_id);
43
-        $output = ob_get_contents();
44
-        ob_end_clean();
45
-        $this->assertContains( 'geodir_my_favourites', $output );
41
+		ob_start();
42
+		geodir_user_show_favourites($user_id);
43
+		$output = ob_get_contents();
44
+		ob_end_clean();
45
+		$this->assertContains( 'geodir_my_favourites', $output );
46 46
 
47
-    }
47
+	}
48 48
 
49
-    public function testDisplayUserListings() {
49
+	public function testDisplayUserListings() {
50 50
 
51
-        global $current_user;
51
+		global $current_user;
52 52
 
53
-        $user_id = $current_user->ID;
53
+		$user_id = $current_user->ID;
54 54
 
55
-        ob_start();
56
-        geodir_user_show_listings($user_id);
57
-        $output = ob_get_contents();
58
-        ob_end_clean();
59
-        $this->assertContains( 'geodir_my_listings', $output );
55
+		ob_start();
56
+		geodir_user_show_listings($user_id);
57
+		$output = ob_get_contents();
58
+		ob_end_clean();
59
+		$this->assertContains( 'geodir_my_listings', $output );
60 60
 
61
-    }
61
+	}
62 62
 
63
-    public function tearDown()
64
-    {
65
-        parent::tearDown();
66
-    }
63
+	public function tearDown()
64
+	{
65
+		parent::tearDown();
66
+	}
67 67
 }
68 68
 ?>
69 69
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
             'posts_per_page' => 1,
20 20
         );
21 21
 
22
-        $all_posts = new WP_Query( $query_args );
22
+        $all_posts = new WP_Query($query_args);
23 23
         $post_id = null;
24
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
24
+        while ($all_posts->have_posts()) : $all_posts->the_post();
25 25
             $post_id = get_the_ID();
26 26
         endwhile;
27 27
 
@@ -31,18 +31,18 @@  discard block
 block discarded – undo
31 31
         geodir_add_to_favorite($post_id);
32 32
         $output = ob_get_contents();
33 33
         ob_end_clean();
34
-        $this->assertContains( 'Remove from Favorites', $output );
34
+        $this->assertContains('Remove from Favorites', $output);
35 35
 
36 36
 
37 37
         $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
38 38
 
39
-        $this->assertContains( $post_id, $user_fav_posts );
39
+        $this->assertContains($post_id, $user_fav_posts);
40 40
 
41 41
         ob_start();
42 42
         geodir_user_show_favourites($user_id);
43 43
         $output = ob_get_contents();
44 44
         ob_end_clean();
45
-        $this->assertContains( 'geodir_my_favourites', $output );
45
+        $this->assertContains('geodir_my_favourites', $output);
46 46
 
47 47
     }
48 48
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         geodir_user_show_listings($user_id);
57 57
         $output = ob_get_contents();
58 58
         ob_end_clean();
59
-        $this->assertContains( 'geodir_my_listings', $output );
59
+        $this->assertContains('geodir_my_listings', $output);
60 60
 
61 61
     }
62 62
 
Please login to merge, or discard this patch.
tests/test-Install_uninstall.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 	function drop_tables() {
30 30
 		global $wpdb, $plugin_prefix;
31 31
 		//build our query to delete our custom table
32
-		$sql = "DROP TABLE IF EXISTS " . GEODIR_COUNTRIES_TABLE . ", " . GEODIR_ICON_TABLE . ", " . GEODIR_CUSTOM_FIELDS_TABLE . ", " . $plugin_prefix . "gd_place_detail, " . GEODIR_ATTACHMENT_TABLE . ", " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . ", " . GEODIR_REVIEW_TABLE . ";";
32
+		$sql = "DROP TABLE IF EXISTS ".GEODIR_COUNTRIES_TABLE.", ".GEODIR_ICON_TABLE.", ".GEODIR_CUSTOM_FIELDS_TABLE.", ".$plugin_prefix."gd_place_detail, ".GEODIR_ATTACHMENT_TABLE.", ".GEODIR_CUSTOM_SORT_FIELDS_TABLE.", ".GEODIR_REVIEW_TABLE.";";
33 33
 
34 34
 		//execute the query deleting the table
35 35
 		$wpdb->query($sql);
Please login to merge, or discard this patch.
tests/test-Misc.php 2 patches
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -1,102 +1,102 @@
 block discarded – undo
1 1
 <?php
2 2
 class MiscTests extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        wp_set_current_user(1);
8
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(1);
8
+	}
9 9
 
10
-    public function testOptionDesignSettings() {
10
+	public function testOptionDesignSettings() {
11 11
 
12
-        geodir_post_type_setting_fun();
13
-        global $geodir_settings;
12
+		geodir_post_type_setting_fun();
13
+		global $geodir_settings;
14 14
 
15
-        $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/design_settings_array.php';
16
-        include_once($template);
15
+		$template = geodir_plugin_path() . '/geodirectory-admin/option-pages/design_settings_array.php';
16
+		include_once($template);
17 17
 
18
-        $output = $geodir_settings['design_settings'];
18
+		$output = $geodir_settings['design_settings'];
19 19
 
20
-        $this->assertContains('Home Top Section Settings', $output[1]['name']);
21
-    }
20
+		$this->assertContains('Home Top Section Settings', $output[1]['name']);
21
+	}
22 22
 
23
-    public function testOptionGeneralSettings() {
23
+	public function testOptionGeneralSettings() {
24 24
 
25
-        geodir_post_type_setting_fun();
26
-        global $geodir_settings;
25
+		geodir_post_type_setting_fun();
26
+		global $geodir_settings;
27 27
 
28
-        $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/general_settings_array.php';
29
-        include_once($template);
28
+		$template = geodir_plugin_path() . '/geodirectory-admin/option-pages/general_settings_array.php';
29
+		include_once($template);
30 30
 
31
-        $output = $geodir_settings['general_settings'];
31
+		$output = $geodir_settings['general_settings'];
32 32
 
33
-        $this->assertContains('General', $output[0]['name']);
34
-    }
33
+		$this->assertContains('General', $output[0]['name']);
34
+	}
35 35
 
36
-    public function testOptionNotiSettings() {
36
+	public function testOptionNotiSettings() {
37 37
 
38
-        geodir_post_type_setting_fun();
39
-        global $geodir_settings;
38
+		geodir_post_type_setting_fun();
39
+		global $geodir_settings;
40 40
 
41
-        $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/notifications_settings_array.php';
42
-        include_once($template);
41
+		$template = geodir_plugin_path() . '/geodirectory-admin/option-pages/notifications_settings_array.php';
42
+		include_once($template);
43 43
 
44
-        $output = $geodir_settings['notifications_settings'];
44
+		$output = $geodir_settings['notifications_settings'];
45 45
 
46
-        $this->assertContains('Options', $output[0]['name']);
47
-    }
46
+		$this->assertContains('Options', $output[0]['name']);
47
+	}
48 48
 
49
-    public function testOptionPermalinkSettings() {
49
+	public function testOptionPermalinkSettings() {
50 50
 
51
-        geodir_post_type_setting_fun();
52
-        global $geodir_settings;
51
+		geodir_post_type_setting_fun();
52
+		global $geodir_settings;
53 53
 
54
-        $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/permalink_settings_array.php';
55
-        include_once($template);
54
+		$template = geodir_plugin_path() . '/geodirectory-admin/option-pages/permalink_settings_array.php';
55
+		include_once($template);
56 56
 
57
-        $output = $geodir_settings['permalink_settings'];
57
+		$output = $geodir_settings['permalink_settings'];
58 58
 
59
-        $this->assertContains('Permalink', $output[0]['name']);
60
-    }
59
+		$this->assertContains('Permalink', $output[0]['name']);
60
+	}
61 61
 
62
-    public function testOptionMetaSettings() {
62
+	public function testOptionMetaSettings() {
63 63
 
64
-        geodir_post_type_setting_fun();
65
-        global $geodir_settings;
64
+		geodir_post_type_setting_fun();
65
+		global $geodir_settings;
66 66
 
67
-        $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/title_meta_settings_array.php';
68
-        include_once($template);
67
+		$template = geodir_plugin_path() . '/geodirectory-admin/option-pages/title_meta_settings_array.php';
68
+		include_once($template);
69 69
 
70
-        $output = $geodir_settings['title_meta_settings'];
70
+		$output = $geodir_settings['title_meta_settings'];
71 71
 
72
-        $this->assertContains('Title / Meta', $output[0]['name']);
73
-    }
72
+		$this->assertContains('Title / Meta', $output[0]['name']);
73
+	}
74 74
 
75
-    public function testDiagnose() {
76
-        ob_start();
77
-        geodir_diagnose_default_pages();
78
-        $output = ob_get_contents();
79
-        ob_end_clean();
80
-        $this->assertContains( 'GD Home page exists with proper setting', $output );
81
-        $this->assertContains( 'Add Listing page exists with proper setting', $output );
82
-        $this->assertContains( 'Listing Preview page exists with proper setting', $output );
83
-        $this->assertContains( 'Listing Success page exists with proper setting', $output );
84
-        $this->assertContains( 'Info page exists with proper setting', $output );
85
-        $this->assertContains( 'Login page exists with proper setting', $output );
86
-        $this->assertContains( 'Location page exists with proper setting', $output );
75
+	public function testDiagnose() {
76
+		ob_start();
77
+		geodir_diagnose_default_pages();
78
+		$output = ob_get_contents();
79
+		ob_end_clean();
80
+		$this->assertContains( 'GD Home page exists with proper setting', $output );
81
+		$this->assertContains( 'Add Listing page exists with proper setting', $output );
82
+		$this->assertContains( 'Listing Preview page exists with proper setting', $output );
83
+		$this->assertContains( 'Listing Success page exists with proper setting', $output );
84
+		$this->assertContains( 'Info page exists with proper setting', $output );
85
+		$this->assertContains( 'Login page exists with proper setting', $output );
86
+		$this->assertContains( 'Location page exists with proper setting', $output );
87 87
 
88
-        ob_start();
89
-        geodir_diagnose_load_db_language();
90
-        $output = ob_get_contents();
91
-        ob_end_clean();
92
-        $this->assertContains( 'ul', $output );
88
+		ob_start();
89
+		geodir_diagnose_load_db_language();
90
+		$output = ob_get_contents();
91
+		ob_end_clean();
92
+		$this->assertContains( 'ul', $output );
93 93
 
94
-    }
94
+	}
95 95
 
96
-    public function tearDown()
97
-    {
98
-        parent::tearDown();
99
-    }
96
+	public function tearDown()
97
+	{
98
+		parent::tearDown();
99
+	}
100 100
 
101 101
 }
102 102
 ?>
103 103
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
         geodir_post_type_setting_fun();
13 13
         global $geodir_settings;
14 14
 
15
-        $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/design_settings_array.php';
15
+        $template = geodir_plugin_path().'/geodirectory-admin/option-pages/design_settings_array.php';
16 16
         include_once($template);
17 17
 
18 18
         $output = $geodir_settings['design_settings'];
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         geodir_post_type_setting_fun();
26 26
         global $geodir_settings;
27 27
 
28
-        $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/general_settings_array.php';
28
+        $template = geodir_plugin_path().'/geodirectory-admin/option-pages/general_settings_array.php';
29 29
         include_once($template);
30 30
 
31 31
         $output = $geodir_settings['general_settings'];
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         geodir_post_type_setting_fun();
39 39
         global $geodir_settings;
40 40
 
41
-        $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/notifications_settings_array.php';
41
+        $template = geodir_plugin_path().'/geodirectory-admin/option-pages/notifications_settings_array.php';
42 42
         include_once($template);
43 43
 
44 44
         $output = $geodir_settings['notifications_settings'];
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         geodir_post_type_setting_fun();
52 52
         global $geodir_settings;
53 53
 
54
-        $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/permalink_settings_array.php';
54
+        $template = geodir_plugin_path().'/geodirectory-admin/option-pages/permalink_settings_array.php';
55 55
         include_once($template);
56 56
 
57 57
         $output = $geodir_settings['permalink_settings'];
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         geodir_post_type_setting_fun();
65 65
         global $geodir_settings;
66 66
 
67
-        $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/title_meta_settings_array.php';
67
+        $template = geodir_plugin_path().'/geodirectory-admin/option-pages/title_meta_settings_array.php';
68 68
         include_once($template);
69 69
 
70 70
         $output = $geodir_settings['title_meta_settings'];
@@ -77,19 +77,19 @@  discard block
 block discarded – undo
77 77
         geodir_diagnose_default_pages();
78 78
         $output = ob_get_contents();
79 79
         ob_end_clean();
80
-        $this->assertContains( 'GD Home page exists with proper setting', $output );
81
-        $this->assertContains( 'Add Listing page exists with proper setting', $output );
82
-        $this->assertContains( 'Listing Preview page exists with proper setting', $output );
83
-        $this->assertContains( 'Listing Success page exists with proper setting', $output );
84
-        $this->assertContains( 'Info page exists with proper setting', $output );
85
-        $this->assertContains( 'Login page exists with proper setting', $output );
86
-        $this->assertContains( 'Location page exists with proper setting', $output );
80
+        $this->assertContains('GD Home page exists with proper setting', $output);
81
+        $this->assertContains('Add Listing page exists with proper setting', $output);
82
+        $this->assertContains('Listing Preview page exists with proper setting', $output);
83
+        $this->assertContains('Listing Success page exists with proper setting', $output);
84
+        $this->assertContains('Info page exists with proper setting', $output);
85
+        $this->assertContains('Login page exists with proper setting', $output);
86
+        $this->assertContains('Location page exists with proper setting', $output);
87 87
 
88 88
         ob_start();
89 89
         geodir_diagnose_load_db_language();
90 90
         $output = ob_get_contents();
91 91
         ob_end_clean();
92
-        $this->assertContains( 'ul', $output );
92
+        $this->assertContains('ul', $output);
93 93
 
94 94
     }
95 95
 
Please login to merge, or discard this patch.
tests/test-Admin.php 2 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -1,75 +1,75 @@
 block discarded – undo
1 1
 <?php
2 2
 class AdminTests extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        wp_set_current_user(1);
8
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(1);
8
+	}
9 9
 
10
-    public function testAdminPanel()
11
-    {
10
+	public function testAdminPanel()
11
+	{
12 12
 
13
-        $_POST = array(
14
-            'geodir_wrapper_open_id' => '',
15
-            'geodir_wrapper_open_class' => 'main-container clearfix',
16
-            'geodir_wrapper_open_replace' => '',
17
-            'geodir_wrapper_close_replace' => '',
18
-            'geodir_wrapper_content_open_id' => '',
19
-            'geodir_wrapper_content_open_class' => '',
20
-            'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content  "><div class="site-content page-wrap">',
21
-            'geodir_wrapper_content_close_replace' => '</div></div></div>',
22
-            'geodir_article_open_id' => '',
23
-            'geodir_article_open_class' => '',
24
-            'geodir_article_open_replace' => '',
25
-            'geodir_article_close_replace' => '',
26
-            'geodir_sidebar_right_open_id' => '',
27
-            'geodir_sidebar_right_open_class' => '',
28
-            'geodir_sidebar_right_open_replace' => '<aside  class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
29
-            'geodir_sidebar_right_close_replace' => '',
30
-            'geodir_sidebar_left_open_id' => '',
31
-            'geodir_sidebar_left_open_class' => '',
32
-            'geodir_sidebar_left_open_replace' => '<aside  class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
33
-            'geodir_sidebar_left_close_replace' => '',
34
-            'geodir_main_content_open_id' => '',
35
-            'geodir_main_content_open_class' => '',
36
-            'geodir_main_content_open_replace' => '<div class="site-content page-wrap">',
37
-            'geodir_main_content_close_replace' => '</div>',
38
-            'geodir_top_content_add' => '',
39
-            'geodir_before_main_content_add' => '',
40
-            'geodir_full_page_class_filter' => 'section full-width-section',
41
-            'geodir_before_widget_filter' => '',
42
-            'geodir_after_widget_filter' => '',
43
-            'geodir_before_title_filter' => '<div class="widget-title"><h2>',
44
-            'geodir_after_title_filter' => '</h2></div>',
45
-            'geodir_menu_li_class_filter' => '',
46
-            'geodir_sub_menu_ul_class_filter' => '',
47
-            'geodir_sub_menu_li_class_filter' => '',
48
-            'geodir_menu_a_class_filter' => '',
49
-            'geodir_sub_menu_a_class_filter' => '',
50
-            'geodir_location_switcher_menu_li_class_filter' => '',
51
-            'geodir_location_switcher_menu_a_class_filter' => '',
52
-            'geodir_location_switcher_menu_sub_ul_class_filter' => '',
53
-            'geodir_location_switcher_menu_sub_li_class_filter' => '',
54
-            'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
55
-            'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
56
-            'geodir_theme_compat_default_options' => '',
57
-            'geodir_theme_compat_code' => 'Multi_News',
58
-            'gd_theme_compat' => 'Twenty_Fifteen_custom'
59
-        );
60
-        geodir_update_options_compatibility_settings();
13
+		$_POST = array(
14
+			'geodir_wrapper_open_id' => '',
15
+			'geodir_wrapper_open_class' => 'main-container clearfix',
16
+			'geodir_wrapper_open_replace' => '',
17
+			'geodir_wrapper_close_replace' => '',
18
+			'geodir_wrapper_content_open_id' => '',
19
+			'geodir_wrapper_content_open_class' => '',
20
+			'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content  "><div class="site-content page-wrap">',
21
+			'geodir_wrapper_content_close_replace' => '</div></div></div>',
22
+			'geodir_article_open_id' => '',
23
+			'geodir_article_open_class' => '',
24
+			'geodir_article_open_replace' => '',
25
+			'geodir_article_close_replace' => '',
26
+			'geodir_sidebar_right_open_id' => '',
27
+			'geodir_sidebar_right_open_class' => '',
28
+			'geodir_sidebar_right_open_replace' => '<aside  class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
29
+			'geodir_sidebar_right_close_replace' => '',
30
+			'geodir_sidebar_left_open_id' => '',
31
+			'geodir_sidebar_left_open_class' => '',
32
+			'geodir_sidebar_left_open_replace' => '<aside  class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
33
+			'geodir_sidebar_left_close_replace' => '',
34
+			'geodir_main_content_open_id' => '',
35
+			'geodir_main_content_open_class' => '',
36
+			'geodir_main_content_open_replace' => '<div class="site-content page-wrap">',
37
+			'geodir_main_content_close_replace' => '</div>',
38
+			'geodir_top_content_add' => '',
39
+			'geodir_before_main_content_add' => '',
40
+			'geodir_full_page_class_filter' => 'section full-width-section',
41
+			'geodir_before_widget_filter' => '',
42
+			'geodir_after_widget_filter' => '',
43
+			'geodir_before_title_filter' => '<div class="widget-title"><h2>',
44
+			'geodir_after_title_filter' => '</h2></div>',
45
+			'geodir_menu_li_class_filter' => '',
46
+			'geodir_sub_menu_ul_class_filter' => '',
47
+			'geodir_sub_menu_li_class_filter' => '',
48
+			'geodir_menu_a_class_filter' => '',
49
+			'geodir_sub_menu_a_class_filter' => '',
50
+			'geodir_location_switcher_menu_li_class_filter' => '',
51
+			'geodir_location_switcher_menu_a_class_filter' => '',
52
+			'geodir_location_switcher_menu_sub_ul_class_filter' => '',
53
+			'geodir_location_switcher_menu_sub_li_class_filter' => '',
54
+			'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
55
+			'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
56
+			'geodir_theme_compat_default_options' => '',
57
+			'geodir_theme_compat_code' => 'Multi_News',
58
+			'gd_theme_compat' => 'Twenty_Fifteen_custom'
59
+		);
60
+		geodir_update_options_compatibility_settings();
61 61
 
62
-        ob_start();
63
-        geodir_admin_panel();
64
-        $output = ob_get_contents();
65
-        ob_end_clean();
66
-        $this->assertContains( 'gd-wrapper-main', $output );
62
+		ob_start();
63
+		geodir_admin_panel();
64
+		$output = ob_get_contents();
65
+		ob_end_clean();
66
+		$this->assertContains( 'gd-wrapper-main', $output );
67 67
 
68
-    }
68
+	}
69 69
 
70
-    public function tearDown()
71
-    {
72
-        parent::tearDown();
73
-    }
70
+	public function tearDown()
71
+	{
72
+		parent::tearDown();
73
+	}
74 74
 }
75 75
 ?>
76 76
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
         geodir_admin_panel();
64 64
         $output = ob_get_contents();
65 65
         ob_end_clean();
66
-        $this->assertContains( 'gd-wrapper-main', $output );
66
+        $this->assertContains('gd-wrapper-main', $output);
67 67
 
68 68
     }
69 69
 
Please login to merge, or discard this patch.