Passed
Pull Request — master (#235)
by Viruthagiri
17:11
created
tests/test-GeoDirectory.php 1 patch
Spacing   +134 added lines, -134 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);
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         global $information;
192 192
         $information = "hello world";
193 193
 
194
-        $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
194
+        $template = geodir_plugin_path().'/geodirectory-templates/geodir-information.php';
195 195
 
196 196
         ob_start();
197 197
         include($template);
@@ -209,9 +209,9 @@  discard block
 block discarded – undo
209 209
             'posts_per_page' => 1,
210 210
         );
211 211
 
212
-        $all_posts = new WP_Query( $query_args );
212
+        $all_posts = new WP_Query($query_args);
213 213
         $post_id = null;
214
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
214
+        while ($all_posts->have_posts()) : $all_posts->the_post();
215 215
             $post_id = get_the_ID();
216 216
         endwhile;
217 217
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         $_REQUEST['listing_type'] = 'gd_place';
221 221
         $_REQUEST['pid'] = $post_id;
222 222
         ob_start();
223
-        $this->go_to( get_permalink(geodir_success_page_id()) );
223
+        $this->go_to(get_permalink(geodir_success_page_id()));
224 224
         $this->load_template();
225 225
         $output = ob_get_contents();
226 226
         ob_end_clean();
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
             'posts_per_page' => 1,
237 237
         );
238 238
 
239
-        $all_posts = new WP_Query( $query_args );
239
+        $all_posts = new WP_Query($query_args);
240 240
         $post_id = null;
241
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
241
+        while ($all_posts->have_posts()) : $all_posts->the_post();
242 242
             $post_id = get_the_ID();
243 243
         endwhile;
244 244
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         );
271 271
 
272 272
         ob_start();
273
-        $this->go_to( get_permalink(geodir_preview_page_id()) );
273
+        $this->go_to(get_permalink(geodir_preview_page_id()));
274 274
         $this->load_template();
275 275
         $output = ob_get_contents();
276 276
         ob_end_clean();
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         wp_set_current_user(1);
282 282
 
283 283
         ob_start();
284
-        $this->go_to( get_permalink(geodir_add_listing_page_id()) );
284
+        $this->go_to(get_permalink(geodir_add_listing_page_id()));
285 285
         $this->load_template();
286 286
         $output = ob_get_contents();
287 287
         ob_end_clean();
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         wp_set_current_user(1);
293 293
 
294 294
         ob_start();
295
-        $this->go_to( get_permalink(geodir_location_page_id()) );
295
+        $this->go_to(get_permalink(geodir_location_page_id()));
296 296
         $this->load_template();
297 297
         $output = ob_get_contents();
298 298
         ob_end_clean();
@@ -307,15 +307,15 @@  discard block
 block discarded – undo
307 307
 
308 308
         $this->setPermalinkStructure();
309 309
 
310
-        $homepage = get_page_by_title( 'GD Home page' );
311
-        if ( $homepage )
310
+        $homepage = get_page_by_title('GD Home page');
311
+        if ($homepage)
312 312
         {
313
-            update_option( 'page_on_front', $homepage->ID );
314
-            update_option( 'show_on_front', 'page' );
313
+            update_option('page_on_front', $homepage->ID);
314
+            update_option('show_on_front', 'page');
315 315
         }
316 316
 
317 317
         ob_start();
318
-        $this->go_to( home_url('/') );
318
+        $this->go_to(home_url('/'));
319 319
         $this->load_template();
320 320
         $output = ob_get_contents();
321 321
         ob_end_clean();
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 
324 324
 
325 325
         ob_start();
326
-        $this->go_to( home_url('/?post_type=gd_place') );
326
+        $this->go_to(home_url('/?post_type=gd_place'));
327 327
         $this->load_template();
328 328
         $output = ob_get_contents();
329 329
         ob_end_clean();
@@ -335,9 +335,9 @@  discard block
 block discarded – undo
335 335
             'posts_per_page' => 1,
336 336
         );
337 337
 
338
-        $all_posts = new WP_Query( $query_args );
338
+        $all_posts = new WP_Query($query_args);
339 339
         $post_id = null;
340
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
340
+        while ($all_posts->have_posts()) : $all_posts->the_post();
341 341
             $post_id = get_the_ID();
342 342
         endwhile;
343 343
 
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
         global $preview;
347 347
         $preview = false;
348 348
         ob_start();
349
-        $this->go_to( get_permalink($post_id) );
349
+        $this->go_to(get_permalink($post_id));
350 350
         $this->load_template();
351 351
         $output = ob_get_contents();
352 352
         ob_end_clean();
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
         ob_start();
356 356
         $_REQUEST['stype'] = 'gd_place';
357 357
         $_REQUEST['geodir_dashbord'] = true;
358
-        $this->go_to( get_author_posts_url($user_id) );
358
+        $this->go_to(get_author_posts_url($user_id));
359 359
         $this->load_template();
360 360
         $output = ob_get_contents();
361 361
         ob_end_clean();
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         ob_start();
368 368
         $_REQUEST['geodir_search'] = "1";
369 369
         $_REQUEST['stype'] = 'gd_place';
370
-        $this->go_to( home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon=') );
370
+        $this->go_to(home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon='));
371 371
         $this->load_template();
372 372
         $output = ob_get_contents();
373 373
         ob_end_clean();
@@ -383,9 +383,9 @@  discard block
 block discarded – undo
383 383
             'posts_per_page' => 1,
384 384
         );
385 385
 
386
-        $all_posts = new WP_Query( $query_args );
386
+        $all_posts = new WP_Query($query_args);
387 387
         $post_id = null;
388
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
388
+        while ($all_posts->have_posts()) : $all_posts->the_post();
389 389
             $post_id = get_the_ID();
390 390
         endwhile;
391 391
 
@@ -413,9 +413,9 @@  discard block
 block discarded – undo
413 413
             'posts_per_page' => 1,
414 414
         );
415 415
 
416
-        $all_posts = new WP_Query( $query_args );
416
+        $all_posts = new WP_Query($query_args);
417 417
         $post_id = null;
418
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
418
+        while ($all_posts->have_posts()) : $all_posts->the_post();
419 419
             $post_id = get_the_ID();
420 420
         endwhile;
421 421
 
@@ -436,23 +436,23 @@  discard block
 block discarded – undo
436 436
         $menuname = 'Primary Menu';
437 437
         $menulocation = 'primary';
438 438
         // Does the menu exist already?
439
-        $menu_exists = wp_get_nav_menu_object( $menuname );
439
+        $menu_exists = wp_get_nav_menu_object($menuname);
440 440
 
441 441
         // If it doesn't exist, let's create it.
442
-        if( !$menu_exists){
442
+        if (!$menu_exists) {
443 443
             $menu_id = wp_create_nav_menu($menuname);
444 444
 
445 445
             // Set up default BuddyPress links and add them to the menu.
446 446
             wp_update_nav_menu_item($menu_id, 0, array(
447 447
                 'menu-item-title' =>  __('Home'),
448 448
                 'menu-item-classes' => 'home',
449
-                'menu-item-url' => home_url( '/' ),
449
+                'menu-item-url' => home_url('/'),
450 450
                 'menu-item-status' => 'publish'));
451 451
 
452
-            if( !has_nav_menu( $menulocation ) ){
452
+            if (!has_nav_menu($menulocation)) {
453 453
                 $locations = get_theme_mod('nav_menu_locations');
454 454
                 $locations[$menulocation] = $menu_id;
455
-                set_theme_mod( 'nav_menu_locations', $locations );
455
+                set_theme_mod('nav_menu_locations', $locations);
456 456
             }
457 457
 
458 458
             update_option('geodir_theme_location_nav', array('primary'));
@@ -469,20 +469,20 @@  discard block
 block discarded – undo
469 469
     }
470 470
 
471 471
     public function testBestOfWidget() {
472
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php';
472
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_bestof_widget.php';
473 473
         include_once($template);
474 474
 
475 475
         ob_start();
476 476
         $instance = array();
477 477
         $instance['use_viewing_post_type'] = '1';
478 478
         $instance['excerpt_type'] = 'show-reviews';
479
-        the_widget( 'geodir_bestof_widget' );
479
+        the_widget('geodir_bestof_widget');
480 480
         $output = ob_get_contents();
481 481
         ob_end_clean();
482 482
         $this->assertContains('bestof-widget-tab-layout', $output);
483 483
 
484 484
         ob_start();
485
-        $this->the_widget_form( 'geodir_bestof_widget' );
485
+        $this->the_widget_form('geodir_bestof_widget');
486 486
         $output = ob_get_contents();
487 487
         ob_end_clean();
488 488
         $this->assertContains('Number of categories', $output);
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
             'excerpt_type' => 'show-desc',
499 499
             'use_viewing_post_type' => '1'
500 500
         );
501
-        $output = $this->the_widget_form_update( 'geodir_bestof_widget', $new_instance );
501
+        $output = $this->the_widget_form_update('geodir_bestof_widget', $new_instance);
502 502
         $this->assertContains('20', $output['character_count']);
503 503
 
504 504
         ob_start();
@@ -510,17 +510,17 @@  discard block
 block discarded – undo
510 510
     }
511 511
 
512 512
     public function testCptCatsWidget() {
513
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_cpt_categories_widget.php';
513
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_cpt_categories_widget.php';
514 514
         include_once($template);
515 515
 
516 516
         ob_start();
517
-        the_widget( 'geodir_cpt_categories_widget' );
517
+        the_widget('geodir_cpt_categories_widget');
518 518
         $output = ob_get_contents();
519 519
         ob_end_clean();
520 520
         $this->assertContains('geodir_cpt_categories_widget', $output);
521 521
 
522 522
         ob_start();
523
-        $this->the_widget_form( 'geodir_cpt_categories_widget' );
523
+        $this->the_widget_form('geodir_cpt_categories_widget');
524 524
         $output = ob_get_contents();
525 525
         ob_end_clean();
526 526
         $this->assertContains('Select CPT', $output);
@@ -536,13 +536,13 @@  discard block
 block discarded – undo
536 536
             'max_count' => 'all',
537 537
             'max_level' => '1'
538 538
         );
539
-        $output = $this->the_widget_form_update( 'geodir_cpt_categories_widget', $new_instance );
539
+        $output = $this->the_widget_form_update('geodir_cpt_categories_widget', $new_instance);
540 540
         $this->assertContains('count', $output['sort_by']);
541 541
 
542 542
     }
543 543
 
544 544
     public function testFeaturesWidget() {
545
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_features_widget.php';
545
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_features_widget.php';
546 546
         include_once($template);
547 547
 
548 548
         $instance = array(
@@ -554,13 +554,13 @@  discard block
 block discarded – undo
554 554
         );
555 555
 
556 556
         ob_start();
557
-        the_widget( 'Geodir_Features_Widget', $instance);
557
+        the_widget('Geodir_Features_Widget', $instance);
558 558
         $output = ob_get_contents();
559 559
         ob_end_clean();
560 560
         $this->assertContains('widget_gd_features', $output);
561 561
 
562 562
         ob_start();
563
-        $this->the_widget_form( 'Geodir_Features_Widget', $instance );
563
+        $this->the_widget_form('Geodir_Features_Widget', $instance);
564 564
         $output = ob_get_contents();
565 565
         ob_end_clean();
566 566
         $this->assertContains('Font Awesome Icon Color', $output);
@@ -572,23 +572,23 @@  discard block
 block discarded – undo
572 572
             'image1' => 'fa-recycle',
573 573
             'desc1' => 'cool',
574 574
         );
575
-        $output = $this->the_widget_form_update( 'Geodir_Features_Widget', $new_instance );
575
+        $output = $this->the_widget_form_update('Geodir_Features_Widget', $new_instance);
576 576
         $this->assertContains('Features', $output['title']);
577 577
 
578 578
     }
579 579
 
580 580
     public function testSliderWidget() {
581
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_listing_slider_widget.php';
581
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_listing_slider_widget.php';
582 582
         include_once($template);
583 583
 
584 584
         ob_start();
585
-        the_widget( 'geodir_listing_slider_widget' );
585
+        the_widget('geodir_listing_slider_widget');
586 586
         $output = ob_get_contents();
587 587
         ob_end_clean();
588 588
         $this->assertContains('geodir_listing_slider_view', $output);
589 589
 
590 590
         ob_start();
591
-        $this->the_widget_form( 'geodir_listing_slider_widget' );
591
+        $this->the_widget_form('geodir_listing_slider_widget');
592 592
         $output = ob_get_contents();
593 593
         ob_end_clean();
594 594
         $this->assertContains('Slide Show Speed', $output);
@@ -610,23 +610,23 @@  discard block
 block discarded – undo
610 610
             'list_sort' => 'latest',
611 611
             'show_featured_only' => '',
612 612
         );
613
-        $output = $this->the_widget_form_update( 'geodir_listing_slider_widget', $new_instance );
613
+        $output = $this->the_widget_form_update('geodir_listing_slider_widget', $new_instance);
614 614
         $this->assertContains('latest', $output['list_sort']);
615 615
 
616 616
     }
617 617
 
618 618
     public function testPopularWidget() {
619
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_popular_widget.php';
619
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_popular_widget.php';
620 620
         include_once($template);
621 621
 
622 622
         ob_start();
623
-        the_widget( 'geodir_popular_post_category' );
623
+        the_widget('geodir_popular_post_category');
624 624
         $output = ob_get_contents();
625 625
         ob_end_clean();
626 626
         $this->assertContains('geodir_popular_post_category', $output);
627 627
 
628 628
         ob_start();
629
-        $this->the_widget_form( 'geodir_popular_post_category' );
629
+        $this->the_widget_form('geodir_popular_post_category');
630 630
         $output = ob_get_contents();
631 631
         ob_end_clean();
632 632
         $this->assertContains('Default post type to use', $output);
@@ -636,19 +636,19 @@  discard block
 block discarded – undo
636 636
             'category_limit' => 15,
637 637
             'default_post_type' => ''
638 638
         );
639
-        $output = $this->the_widget_form_update( 'geodir_popular_post_category', $new_instance );
639
+        $output = $this->the_widget_form_update('geodir_popular_post_category', $new_instance);
640 640
         $this->assertEquals(15, $output['category_limit']);
641 641
 
642 642
         ob_start();
643 643
         $instance = array();
644 644
         $instance['category_title'] = '';
645
-        the_widget( 'geodir_popular_postview', $instance );
645
+        the_widget('geodir_popular_postview', $instance);
646 646
         $output = ob_get_contents();
647 647
         ob_end_clean();
648 648
         $this->assertContains('geodir_popular_post_view', $output);
649 649
 
650 650
         ob_start();
651
-        $this->the_widget_form( 'geodir_popular_postview' );
651
+        $this->the_widget_form('geodir_popular_postview');
652 652
         $output = ob_get_contents();
653 653
         ob_end_clean();
654 654
         $this->assertContains('Post Category', $output);
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
             'with_videos_only' => '',
672 672
             'use_viewing_post_type' => ''
673 673
         );
674
-        $output = $this->the_widget_form_update( 'geodir_popular_postview', $new_instance );
674
+        $output = $this->the_widget_form_update('geodir_popular_postview', $new_instance);
675 675
         $this->assertContains('gridview_onehalf', $output['layout']);
676 676
 
677 677
     }
@@ -683,9 +683,9 @@  discard block
 block discarded – undo
683 683
             'posts_per_page' => 1,
684 684
         );
685 685
 
686
-        $all_posts = new WP_Query( $query_args );
686
+        $all_posts = new WP_Query($query_args);
687 687
         $post_id = null;
688
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
688
+        while ($all_posts->have_posts()) : $all_posts->the_post();
689 689
             global $post;
690 690
             $post_id = get_the_ID();
691 691
             $post = geodir_get_post_info($post->ID);
@@ -693,17 +693,17 @@  discard block
 block discarded – undo
693 693
 //            $term_list = wp_get_post_terms($post->ID, 'gd_placecategory');
694 694
 //            $post->gd_placecategory = (string) $term_list[0]->term_id;
695 695
 
696
-            $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_related_listing_widget.php';
696
+            $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_related_listing_widget.php';
697 697
             include_once($template);
698 698
 
699 699
             ob_start();
700
-            the_widget( 'geodir_related_listing_postview' );
700
+            the_widget('geodir_related_listing_postview');
701 701
             $output = ob_get_contents();
702 702
             ob_end_clean();
703 703
             $this->assertContains('Related Listing', $output);
704 704
 
705 705
             ob_start();
706
-            $this->the_widget_form( 'geodir_related_listing_postview' );
706
+            $this->the_widget_form('geodir_related_listing_postview');
707 707
             $output = ob_get_contents();
708 708
             ob_end_clean();
709 709
             $this->assertContains('Relate to', $output);
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
                 'add_location_filter' => '1',
720 720
                 'character_count' => '20'
721 721
             );
722
-            $output = $this->the_widget_form_update( 'geodir_related_listing_postview', $new_instance );
722
+            $output = $this->the_widget_form_update('geodir_related_listing_postview', $new_instance);
723 723
             $this->assertContains('gridview_onehalf', $output['layout']);
724 724
         endwhile;
725 725
 
@@ -775,17 +775,17 @@  discard block
 block discarded – undo
775 775
 
776 776
         $this->assertTrue(is_int($comment_id));
777 777
 
778
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_reviews_widget.php';
778
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_reviews_widget.php';
779 779
         include_once($template);
780 780
 
781 781
         ob_start();
782
-        the_widget( 'geodir_recent_reviews_widget' );
782
+        the_widget('geodir_recent_reviews_widget');
783 783
         $output = ob_get_contents();
784 784
         ob_end_clean();
785 785
         $this->assertContains('geodir_recent_reviews', $output);
786 786
 
787 787
         ob_start();
788
-        $this->the_widget_form( 'geodir_recent_reviews_widget' );
788
+        $this->the_widget_form('geodir_recent_reviews_widget');
789 789
         $output = ob_get_contents();
790 790
         ob_end_clean();
791 791
         $this->assertContains('Number of Reviews', $output);
@@ -798,25 +798,25 @@  discard block
 block discarded – undo
798 798
             'img1' => '',
799 799
             'count' => ''
800 800
         );
801
-        $output = $this->the_widget_form_update( 'geodir_recent_reviews_widget', $new_instance );
801
+        $output = $this->the_widget_form_update('geodir_recent_reviews_widget', $new_instance);
802 802
         $this->assertTrue(empty($output['count']));
803 803
     }
804 804
 
805 805
     public function testHomeMapWidget() {
806
-        $template = geodir_plugin_path() . '/geodirectory-widgets/home_map_widget.php';
806
+        $template = geodir_plugin_path().'/geodirectory-widgets/home_map_widget.php';
807 807
         include_once($template);
808 808
 
809 809
         ob_start();
810 810
         $instance = array();
811 811
         $args = array();
812 812
         $args["widget_id"] = "geodir_map_v3_home_map-2";
813
-        the_widget( 'geodir_homepage_map', $instance, $args );
813
+        the_widget('geodir_homepage_map', $instance, $args);
814 814
         $output = ob_get_contents();
815 815
         ob_end_clean();
816 816
         $this->assertContains('geodir-map-home-page', $output);
817 817
 
818 818
         ob_start();
819
-        $this->the_widget_form( 'geodir_homepage_map' );
819
+        $this->the_widget_form('geodir_homepage_map');
820 820
         $output = ob_get_contents();
821 821
         ob_end_clean();
822 822
         $this->assertContains('Map Zoom level', $output);
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
             'child_collapse' => '0',
831 831
             'scrollwheel' => '0'
832 832
         );
833
-        $output = $this->the_widget_form_update( 'geodir_homepage_map', $new_instance );
833
+        $output = $this->the_widget_form_update('geodir_homepage_map', $new_instance);
834 834
         $this->assertContains('0', $output['scrollwheel']);
835 835
 
836 836
     }
@@ -840,13 +840,13 @@  discard block
 block discarded – undo
840 840
         register_geodir_widgets();
841 841
 
842 842
         ob_start();
843
-        the_widget( 'geodir_loginwidget' );
843
+        the_widget('geodir_loginwidget');
844 844
         $output = ob_get_contents();
845 845
         ob_end_clean();
846 846
         $this->assertContains('geodir_loginbox', $output);
847 847
 
848 848
         ob_start();
849
-        $this->the_widget_form( 'geodir_loginwidget' );
849
+        $this->the_widget_form('geodir_loginwidget');
850 850
         $output = ob_get_contents();
851 851
         ob_end_clean();
852 852
         $this->assertContains('Widget Title', $output);
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
             'img1' => '',
860 860
             'desc1' => ''
861 861
         );
862
-        $output = $this->the_widget_form_update( 'geodir_loginwidget', $new_instance );
862
+        $output = $this->the_widget_form_update('geodir_loginwidget', $new_instance);
863 863
         $this->assertContains('Login', $output['title']);
864 864
 
865 865
     }
@@ -867,13 +867,13 @@  discard block
 block discarded – undo
867 867
     public function testSocialWidget() {
868 868
 
869 869
         ob_start();
870
-        the_widget( 'geodir_social_like_widget' );
870
+        the_widget('geodir_social_like_widget');
871 871
         $output = ob_get_contents();
872 872
         ob_end_clean();
873 873
         $this->assertContains('twitter.com', $output);
874 874
 
875 875
         ob_start();
876
-        $this->the_widget_form( 'geodir_social_like_widget' );
876
+        $this->the_widget_form('geodir_social_like_widget');
877 877
         $output = ob_get_contents();
878 878
         ob_end_clean();
879 879
         $this->assertContains('No settings for this widget', $output);
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
         $new_instance = array(
882 882
             'title' => 'Social',
883 883
         );
884
-        $output = $this->the_widget_form_update( 'geodir_social_like_widget', $new_instance );
884
+        $output = $this->the_widget_form_update('geodir_social_like_widget', $new_instance);
885 885
         $this->assertContains('Social', $output['title']);
886 886
 
887 887
     }
@@ -889,13 +889,13 @@  discard block
 block discarded – undo
889 889
     public function testSubscribeWidget() {
890 890
 
891 891
         ob_start();
892
-        the_widget( 'geodirsubscribeWidget' );
892
+        the_widget('geodirsubscribeWidget');
893 893
         $output = ob_get_contents();
894 894
         ob_end_clean();
895 895
         $this->assertContains('geodir-subscribe-form', $output);
896 896
 
897 897
         ob_start();
898
-        $this->the_widget_form( 'geodirsubscribeWidget' );
898
+        $this->the_widget_form('geodirsubscribeWidget');
899 899
         $output = ob_get_contents();
900 900
         ob_end_clean();
901 901
         $this->assertContains('Feedburner ID', $output);
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
             'digg' => '',
911 911
             'myspace' => ''
912 912
         );
913
-        $output = $this->the_widget_form_update( 'geodirsubscribeWidget', $new_instance );
913
+        $output = $this->the_widget_form_update('geodirsubscribeWidget', $new_instance);
914 914
         $this->assertContains('Subscribe', $output['title']);
915 915
 
916 916
     }
@@ -920,13 +920,13 @@  discard block
 block discarded – undo
920 920
         ob_start();
921 921
         $instance = array();
922 922
         $instance['desc1'] = 'hello';
923
-        the_widget( 'geodiradvtwidget', $instance );
923
+        the_widget('geodiradvtwidget', $instance);
924 924
         $output = ob_get_contents();
925 925
         ob_end_clean();
926 926
         $this->assertContains('hello', $output);
927 927
 
928 928
         ob_start();
929
-        $this->the_widget_form( 'geodiradvtwidget' );
929
+        $this->the_widget_form('geodiradvtwidget');
930 930
         $output = ob_get_contents();
931 931
         ob_end_clean();
932 932
         $this->assertContains('Your Advt code', $output);
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
         $new_instance = array(
935 935
             'desc1' => 'Advertise'
936 936
         );
937
-        $output = $this->the_widget_form_update( 'geodiradvtwidget', $new_instance );
937
+        $output = $this->the_widget_form_update('geodiradvtwidget', $new_instance);
938 938
         $this->assertContains('Advertise', $output['desc1']);
939 939
 
940 940
     }
@@ -942,13 +942,13 @@  discard block
 block discarded – undo
942 942
     public function testFlickrWidget() {
943 943
 
944 944
         ob_start();
945
-        the_widget( 'GeodirFlickrWidget' );
945
+        the_widget('GeodirFlickrWidget');
946 946
         $output = ob_get_contents();
947 947
         ob_end_clean();
948 948
         $this->assertContains('geodir-flickr', $output);
949 949
 
950 950
         ob_start();
951
-        $this->the_widget_form( 'GeodirFlickrWidget' );
951
+        $this->the_widget_form('GeodirFlickrWidget');
952 952
         $output = ob_get_contents();
953 953
         ob_end_clean();
954 954
         $this->assertContains('Flickr ID', $output);
@@ -957,7 +957,7 @@  discard block
 block discarded – undo
957 957
             'id' => '',
958 958
             'number' => '34'
959 959
         );
960
-        $output = $this->the_widget_form_update( 'GeodirFlickrWidget', $new_instance );
960
+        $output = $this->the_widget_form_update('GeodirFlickrWidget', $new_instance);
961 961
         $this->assertContains('34', $output['number']);
962 962
 
963 963
     }
@@ -967,13 +967,13 @@  discard block
 block discarded – undo
967 967
         ob_start();
968 968
         $instance = array();
969 969
         $instance['gd_tw_desc1'] = 'hello';
970
-        the_widget( 'geodir_twitter', $instance );
970
+        the_widget('geodir_twitter', $instance);
971 971
         $output = ob_get_contents();
972 972
         ob_end_clean();
973 973
         $this->assertContains('hello', $output);
974 974
 
975 975
         ob_start();
976
-        $this->the_widget_form( 'geodir_twitter' );
976
+        $this->the_widget_form('geodir_twitter');
977 977
         $output = ob_get_contents();
978 978
         ob_end_clean();
979 979
         $this->assertContains('Your twitter code', $output);
@@ -981,7 +981,7 @@  discard block
 block discarded – undo
981 981
         $new_instance = array(
982 982
             'gd_tw_desc1' => 'hello'
983 983
         );
984
-        $output = $this->the_widget_form_update( 'geodir_twitter', $new_instance );
984
+        $output = $this->the_widget_form_update('geodir_twitter', $new_instance);
985 985
         $this->assertContains('hello', $output['gd_tw_desc1']);
986 986
 
987 987
     }
@@ -989,13 +989,13 @@  discard block
 block discarded – undo
989 989
     public function testAdvSearchWidget() {
990 990
 
991 991
         ob_start();
992
-        the_widget( 'geodir_advance_search_widget' );
992
+        the_widget('geodir_advance_search_widget');
993 993
         $output = ob_get_contents();
994 994
         ob_end_clean();
995 995
         $this->assertContains('geodir-loc-bar', $output);
996 996
 
997 997
         ob_start();
998
-        $this->the_widget_form( 'geodir_advance_search_widget' );
998
+        $this->the_widget_form('geodir_advance_search_widget');
999 999
         $output = ob_get_contents();
1000 1000
         ob_end_clean();
1001 1001
         $this->assertContains('This is a search widget', $output);
@@ -1009,17 +1009,17 @@  discard block
 block discarded – undo
1009 1009
 
1010 1010
     public function testListingMapWidget() {
1011 1011
 
1012
-        $template = geodir_plugin_path() . '/geodirectory-widgets/listing_map_widget.php';
1012
+        $template = geodir_plugin_path().'/geodirectory-widgets/listing_map_widget.php';
1013 1013
         include_once($template);
1014 1014
 
1015 1015
         //listing page
1016
-        $this->go_to( home_url('/?post_type=gd_place') );
1016
+        $this->go_to(home_url('/?post_type=gd_place'));
1017 1017
 
1018 1018
         ob_start();
1019 1019
         $instance = array();
1020 1020
         $args = array();
1021 1021
         $args["widget_id"] = "geodir_map_v3_listing_map-2";
1022
-        the_widget( 'geodir_map_listingpage', $instance, $args );
1022
+        the_widget('geodir_map_listingpage', $instance, $args);
1023 1023
         $output = ob_get_contents();
1024 1024
         ob_end_clean();
1025 1025
         $this->assertContains('geodir-map-listing-page', $output);
@@ -1031,27 +1031,27 @@  discard block
 block discarded – undo
1031 1031
             'posts_per_page' => 1,
1032 1032
         );
1033 1033
 
1034
-        $all_posts = new WP_Query( $query_args );
1034
+        $all_posts = new WP_Query($query_args);
1035 1035
         $post_id = null;
1036
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
1036
+        while ($all_posts->have_posts()) : $all_posts->the_post();
1037 1037
             $post_id = get_the_ID();
1038 1038
         endwhile;
1039 1039
 
1040 1040
         $this->assertTrue(is_int($post_id));
1041 1041
 
1042
-        $this->go_to( get_permalink($post_id) );
1042
+        $this->go_to(get_permalink($post_id));
1043 1043
 
1044 1044
         ob_start();
1045 1045
         $instance = array();
1046 1046
         $args = array();
1047 1047
         $args["widget_id"] = "geodir_map_v3_listing_map-2";
1048
-        the_widget( 'geodir_map_listingpage', $instance, $args );
1048
+        the_widget('geodir_map_listingpage', $instance, $args);
1049 1049
         $output = ob_get_contents();
1050 1050
         ob_end_clean();
1051 1051
         $this->assertContains('geodir-map-listing-page', $output);
1052 1052
 
1053 1053
         ob_start();
1054
-        $this->the_widget_form( 'geodir_map_listingpage' );
1054
+        $this->the_widget_form('geodir_map_listingpage');
1055 1055
         $output = ob_get_contents();
1056 1056
         ob_end_clean();
1057 1057
         $this->assertContains('Select Map View', $output);
@@ -1066,31 +1066,31 @@  discard block
 block discarded – undo
1066 1066
             'scrollwheel' => '0',
1067 1067
             'showall' => '0'
1068 1068
         );
1069
-        $output = $this->the_widget_form_update( 'geodir_map_listingpage', $new_instance );
1069
+        $output = $this->the_widget_form_update('geodir_map_listingpage', $new_instance);
1070 1070
         $this->assertContains('0', $output['scrollwheel']);
1071 1071
 
1072 1072
 
1073 1073
     }
1074 1074
 
1075 1075
     private function load_template() {
1076
-        do_action( 'template_redirect' );
1076
+        do_action('template_redirect');
1077 1077
         $template = false;
1078
-        if	 ( is_404()			&& $template = get_404_template()			) :
1079
-        elseif ( is_search()		 && $template = get_search_template()		 ) :
1080
-        elseif ( is_front_page()	 && $template = get_front_page_template()	 ) :
1081
-        elseif ( is_home()		   && $template = get_home_template()		   ) :
1082
-        elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) :
1083
-        elseif ( is_tax()			&& $template = get_taxonomy_template()	   ) :
1084
-        elseif ( is_attachment()	 && $template = get_attachment_template()	 ) :
1078
+        if (is_404() && $template = get_404_template()) :
1079
+        elseif (is_search() && $template = get_search_template()) :
1080
+        elseif (is_front_page() && $template = get_front_page_template()) :
1081
+        elseif (is_home() && $template = get_home_template()) :
1082
+        elseif (is_post_type_archive() && $template = get_post_type_archive_template()) :
1083
+        elseif (is_tax() && $template = get_taxonomy_template()) :
1084
+        elseif (is_attachment() && $template = get_attachment_template()) :
1085 1085
             remove_filter('the_content', 'prepend_attachment');
1086
-        elseif ( is_single()		 && $template = get_single_template()		 ) :
1087
-        elseif ( is_page()		   && $template = get_page_template()		   ) :
1088
-        elseif ( is_category()	   && $template = get_category_template()	   ) :
1089
-        elseif ( is_tag()			&& $template = get_tag_template()			) :
1090
-        elseif ( is_author()		 && $template = get_author_template()		 ) :
1091
-        elseif ( is_date()		   && $template = get_date_template()		   ) :
1092
-        elseif ( is_archive()		&& $template = get_archive_template()		) :
1093
-        elseif ( is_paged()		  && $template = get_paged_template()		  ) :
1086
+        elseif (is_single() && $template = get_single_template()) :
1087
+        elseif (is_page() && $template = get_page_template()) :
1088
+        elseif (is_category() && $template = get_category_template()) :
1089
+        elseif (is_tag() && $template = get_tag_template()) :
1090
+        elseif (is_author() && $template = get_author_template()) :
1091
+        elseif (is_date() && $template = get_date_template()) :
1092
+        elseif (is_archive() && $template = get_archive_template()) :
1093
+        elseif (is_paged() && $template = get_paged_template()) :
1094 1094
         else :
1095 1095
             $template = get_index_template();
1096 1096
         endif;
@@ -1101,21 +1101,21 @@  discard block
 block discarded – undo
1101 1101
          *
1102 1102
          * @param string $template The path of the template to include.
1103 1103
          */
1104
-        if ( $template = apply_filters( 'template_include', $template ) ) {
1105
-            $template_contents = file_get_contents( $template );
1104
+        if ($template = apply_filters('template_include', $template)) {
1105
+            $template_contents = file_get_contents($template);
1106 1106
             $included_header = $included_footer = false;
1107
-            if ( false !== stripos( $template_contents, 'get_header();' ) ) {
1108
-                do_action( 'get_header', null );
1109
-                locate_template( 'header.php', true, false );
1107
+            if (false !== stripos($template_contents, 'get_header();')) {
1108
+                do_action('get_header', null);
1109
+                locate_template('header.php', true, false);
1110 1110
                 $included_header = true;
1111 1111
             }
1112
-            include( $template );
1113
-            if ( false !== stripos( $template_contents, 'get_footer();' ) ) {
1114
-                do_action( 'get_footer', null );
1115
-                locate_template( 'footer.php', true, false );
1112
+            include($template);
1113
+            if (false !== stripos($template_contents, 'get_footer();')) {
1114
+                do_action('get_footer', null);
1115
+                locate_template('footer.php', true, false);
1116 1116
                 $included_footer = true;
1117 1117
             }
1118
-            if ( $included_header && $included_footer ) {
1118
+            if ($included_header && $included_footer) {
1119 1119
                 global $wp_scripts;
1120 1120
                 $wp_scripts->done = array();
1121 1121
             }
@@ -1123,19 +1123,19 @@  discard block
 block discarded – undo
1123 1123
         return;
1124 1124
     }
1125 1125
 
1126
-    public static function setPermalinkStructure( $struc = '/%postname%/' ) {
1126
+    public static function setPermalinkStructure($struc = '/%postname%/') {
1127 1127
         global $wp_rewrite;
1128
-        $wp_rewrite->set_permalink_structure( $struc );
1128
+        $wp_rewrite->set_permalink_structure($struc);
1129 1129
         $wp_rewrite->flush_rules();
1130
-        update_option( 'permalink_structure', $struc );
1131
-        flush_rewrite_rules( true );
1130
+        update_option('permalink_structure', $struc);
1131
+        flush_rewrite_rules(true);
1132 1132
     }
1133 1133
 
1134
-    function the_widget_form( $widget, $instance = array() ) {
1134
+    function the_widget_form($widget, $instance = array()) {
1135 1135
         global $wp_widget_factory;
1136 1136
 
1137 1137
         $widget_obj = $wp_widget_factory->widgets[$widget];
1138
-        if ( ! ( $widget_obj instanceof WP_Widget ) ) {
1138
+        if (!($widget_obj instanceof WP_Widget)) {
1139 1139
             return;
1140 1140
         }
1141 1141
 
@@ -1143,11 +1143,11 @@  discard block
 block discarded – undo
1143 1143
         $widget_obj->form($instance);
1144 1144
     }
1145 1145
 
1146
-    function the_widget_form_update( $widget, $new_instance = array(), $old_instance = array() ) {
1146
+    function the_widget_form_update($widget, $new_instance = array(), $old_instance = array()) {
1147 1147
         global $wp_widget_factory;
1148 1148
 
1149 1149
         $widget_obj = $wp_widget_factory->widgets[$widget];
1150
-        if ( ! ( $widget_obj instanceof WP_Widget ) ) {
1150
+        if (!($widget_obj instanceof WP_Widget)) {
1151 1151
             return;
1152 1152
         }
1153 1153
 
Please login to merge, or discard this patch.
geodirectory-templates/listing-detail.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
  * @param string $itemtype The itemtype value of the HTML element.
58 58
  * @see 'geodir_article_close'
59 59
  */
60
-do_action('geodir_article_open', 'details-page', 'post-' . get_the_ID(), get_post_class(), '');
60
+do_action('geodir_article_open', 'details-page', 'post-'.get_the_ID(), get_post_class(), '');
61 61
 
62 62
 ###### MAIN CONTENT ######
63 63
 // this call the main page content
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      * @since 1.1.0
82 82
      */
83 83
     do_action('geodir_action_geodir_set_preview_post'); // set the $post to the preview values
84
-    if (defined( 'GD_TESTING_MODE' )) {
84
+    if (defined('GD_TESTING_MODE')) {
85 85
         global $post;
86 86
     }
87 87
     /** This action is documented in geodirectory-templates/listing-detail.php */
Please login to merge, or discard this patch.