Passed
Pull Request — master (#223)
by Kiran
15:09
created
geodirectory-templates/reg_frm.php 1 patch
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Template for the register for box on the register/signin page
4
- *
5
- * You can make most changes via hooks or see the link below for info on how to replace the template in your theme.
6
- *
7
- * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/
8
- * @since 1.0.0
9
- * @package GeoDirectory
10
- */
3
+				 * Template for the register for box on the register/signin page
4
+				 *
5
+				 * You can make most changes via hooks or see the link below for info on how to replace the template in your theme.
6
+				 *
7
+				 * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/
8
+				 * @since 1.0.0
9
+				 * @package GeoDirectory
10
+				 */
11 11
 if (isset($_GET['redirect_to']) && $_GET['redirect_to'] != '') {
12
-    $redirect_to = $_GET['redirect_to'];
12
+	$redirect_to = $_GET['redirect_to'];
13 13
 } else {
14
-    //echo $_SERVER['HTTP_HOST'] ;
15
-    $redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
16
-    if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
17
-        $redirect_to = home_url();
18
-    }
14
+	//echo $_SERVER['HTTP_HOST'] ;
15
+	$redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
16
+	if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
17
+		$redirect_to = home_url();
18
+	}
19 19
 }
20 20
 ?>
21 21
 <div id="sign_up">
@@ -26,28 +26,28 @@  discard block
 block discarded – undo
26 26
         <h4>
27 27
             <?php
28 28
 
29
-            /**
30
-             * Filter the `REGISTRATION_NOW_TEXT` title text on the register form template.
31
-             *
32
-             * @since 1.0.0
33
-             */
34
-            echo apply_filters('geodir_registration_page_title', REGISTRATION_NOW_TEXT);
29
+			/**
30
+			 * Filter the `REGISTRATION_NOW_TEXT` title text on the register form template.
31
+			 *
32
+			 * @since 1.0.0
33
+			 */
34
+			echo apply_filters('geodir_registration_page_title', REGISTRATION_NOW_TEXT);
35 35
 
36
-            ?>
36
+			?>
37 37
         </h4>
38 38
         <?php
39
-        global $geodir_signup_error;
40
-        if ($geodir_signup_error != '') {
41
-            echo '<p class="error_msg">' . $geodir_signup_error . '</p>';
42
-            unset($geodir_signup_error);
43
-        } else {
44
-            if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) {
45
-                echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>';
46
-            } else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') {
47
-                echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>';
48
-            }
49
-        }
50
-        ?>
39
+		global $geodir_signup_error;
40
+		if ($geodir_signup_error != '') {
41
+			echo '<p class="error_msg">' . $geodir_signup_error . '</p>';
42
+			unset($geodir_signup_error);
43
+		} else {
44
+			if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) {
45
+				echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>';
46
+			} else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') {
47
+				echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>';
48
+			}
49
+		}
50
+		?>
51 51
 
52 52
         <form name="cus_registerform" id="cus_registerform"
53 53
               action="<?php echo htmlspecialchars(geodir_curPageURL()); ?>" method="post">
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
             <div class="form_row clearfix">
58 58
                 <input placeholder='<?php echo EMAIL_TEXT; ?>' type="text" name="user_email" id="user_email"
59 59
                        class="textfield" value="<?php global $user_email;
60
-                if (!isset($user_email)) {
61
-                    $user_email = '';
62
-                }
63
-                echo esc_attr(stripslashes($user_email)); ?>" size="25"/>
60
+				if (!isset($user_email)) {
61
+					$user_email = '';
62
+				}
63
+				echo esc_attr(stripslashes($user_email)); ?>" size="25"/>
64 64
 
65 65
                 <?php if (!get_option('geodir_allow_cpass')) { ?>
66 66
 				<div id="reg_passmail">
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
                 <div class="form_row clearfix">
75 75
                     <input placeholder='<?php echo FIRST_NAME_TEXT; ?>' type="text" name="user_fname" id="user_fname"
76 76
                            class="textfield" value="<?php if (isset($user_fname)) {
77
-                        echo esc_attr(stripslashes($user_fname));
78
-                    } ?>" size="25"/>
77
+						echo esc_attr(stripslashes($user_fname));
78
+					} ?>" size="25"/>
79 79
                     <span id="user_fnameInfo"></span>
80 80
                 </div>
81 81
             </div>
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
             <?php } ?>
102 102
 
103 103
             <?php
104
-            /**
105
-             * Called just before the register new user button on the register form template.
106
-             *
107
-             * Also used by other plugins to add social connect buttons.
108
-             *
109
-             * @since 1.0.0
110
-             */
111
-            do_action('social_connect_form'); ?>
104
+			/**
105
+			 * Called just before the register new user button on the register form template.
106
+			 *
107
+			 * Also used by other plugins to add social connect buttons.
108
+			 *
109
+			 * @since 1.0.0
110
+			 */
111
+			do_action('social_connect_form'); ?>
112 112
             <input type="submit" name="registernow" value="<?php echo REGISTER_NOW_TEXT; ?>" class="geodir_button"/>
113 113
         </form>
114 114
     </div>
Please login to merge, or discard this patch.
tests/test-Check_Maps.php 2 patches
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -1,69 +1,69 @@
 block discarded – undo
1 1
 <?php
2 2
 class CheckMaps extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+	}
8 8
 
9
-    public function testCheckHomeMap()
10
-    {
11
-        $output = do_shortcode('[gd_homepage_map width=100% height=300 scrollwheel=false]');
12
-        $this->assertContains( 'geodir-map-home-page', $output );
13
-    }
9
+	public function testCheckHomeMap()
10
+	{
11
+		$output = do_shortcode('[gd_homepage_map width=100% height=300 scrollwheel=false]');
12
+		$this->assertContains( 'geodir-map-home-page', $output );
13
+	}
14 14
 
15
-    public function testListingsPageMap()
16
-    {
17
-        $output = do_shortcode('[gd_listing_map width=100% height=300 scrollwheel=false sticky=true]');
18
-        $this->assertContains( 'geodir-map-listing-page', $output );
19
-    }
15
+	public function testListingsPageMap()
16
+	{
17
+		$output = do_shortcode('[gd_listing_map width=100% height=300 scrollwheel=false sticky=true]');
18
+		$this->assertContains( 'geodir-map-listing-page', $output );
19
+	}
20 20
 
21
-    public function testDetailPageMap()
22
-    {
21
+	public function testDetailPageMap()
22
+	{
23 23
 
24
-        $query_args = array(
25
-            'post_status' => 'publish',
26
-            'post_type' => 'gd_place',
27
-            'posts_per_page' => 1,
28
-        );
24
+		$query_args = array(
25
+			'post_status' => 'publish',
26
+			'post_type' => 'gd_place',
27
+			'posts_per_page' => 1,
28
+		);
29 29
 
30
-        $all_posts = new WP_Query( $query_args );
31
-        $post_id = null;
32
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
33
-            $post_id = get_the_ID();
34
-            global $post;
35
-            $post =  geodir_get_post_info($post_id);
36
-            setup_postdata($post);
30
+		$all_posts = new WP_Query( $query_args );
31
+		$post_id = null;
32
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
33
+			$post_id = get_the_ID();
34
+			global $post;
35
+			$post =  geodir_get_post_info($post_id);
36
+			setup_postdata($post);
37 37
 
38
-            $map_args = array();
39
-            $map_args['map_canvas_name'] = 'detail_page_map_canvas';
40
-            $map_args['width'] = '600';
41
-            $map_args['height'] = '300';
42
-            if ($post->post_mapzoom) {
43
-                $map_args['zoom'] = '' . $post->post_mapzoom . '';
44
-            }
45
-            $map_args['autozoom'] = false;
46
-            $map_args['child_collapse'] = '0';
47
-            $map_args['enable_cat_filters'] = false;
48
-            $map_args['enable_text_search'] = false;
49
-            $map_args['enable_post_type_filters'] = false;
50
-            $map_args['enable_location_filters'] = false;
51
-            $map_args['enable_jason_on_load'] = true;
52
-            $map_args['enable_map_direction'] = true;
53
-            $map_args['map_class_name'] = 'geodir-map-detail-page';
54
-            $map_args['maptype'] = (!empty($post->post_mapview)) ? $post->post_mapview : 'ROADMAP';
55
-            ob_start();
56
-            geodir_draw_map($map_args);
57
-            $output = ob_get_clean();
58
-            $this->assertContains( 'geodir-map-detail-page', $output );
59
-        endwhile;
38
+			$map_args = array();
39
+			$map_args['map_canvas_name'] = 'detail_page_map_canvas';
40
+			$map_args['width'] = '600';
41
+			$map_args['height'] = '300';
42
+			if ($post->post_mapzoom) {
43
+				$map_args['zoom'] = '' . $post->post_mapzoom . '';
44
+			}
45
+			$map_args['autozoom'] = false;
46
+			$map_args['child_collapse'] = '0';
47
+			$map_args['enable_cat_filters'] = false;
48
+			$map_args['enable_text_search'] = false;
49
+			$map_args['enable_post_type_filters'] = false;
50
+			$map_args['enable_location_filters'] = false;
51
+			$map_args['enable_jason_on_load'] = true;
52
+			$map_args['enable_map_direction'] = true;
53
+			$map_args['map_class_name'] = 'geodir-map-detail-page';
54
+			$map_args['maptype'] = (!empty($post->post_mapview)) ? $post->post_mapview : 'ROADMAP';
55
+			ob_start();
56
+			geodir_draw_map($map_args);
57
+			$output = ob_get_clean();
58
+			$this->assertContains( 'geodir-map-detail-page', $output );
59
+		endwhile;
60 60
 
61 61
 
62
-    }
62
+	}
63 63
 
64
-    public function tearDown()
65
-    {
66
-        parent::tearDown();
67
-    }
64
+	public function tearDown()
65
+	{
66
+		parent::tearDown();
67
+	}
68 68
 }
69 69
 ?>
70 70
\ 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
@@ -9,13 +9,13 @@  discard block
 block discarded – undo
9 9
     public function testCheckHomeMap()
10 10
     {
11 11
         $output = do_shortcode('[gd_homepage_map width=100% height=300 scrollwheel=false]');
12
-        $this->assertContains( 'geodir-map-home-page', $output );
12
+        $this->assertContains('geodir-map-home-page', $output);
13 13
     }
14 14
 
15 15
     public function testListingsPageMap()
16 16
     {
17 17
         $output = do_shortcode('[gd_listing_map width=100% height=300 scrollwheel=false sticky=true]');
18
-        $this->assertContains( 'geodir-map-listing-page', $output );
18
+        $this->assertContains('geodir-map-listing-page', $output);
19 19
     }
20 20
 
21 21
     public function testDetailPageMap()
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
             'posts_per_page' => 1,
28 28
         );
29 29
 
30
-        $all_posts = new WP_Query( $query_args );
30
+        $all_posts = new WP_Query($query_args);
31 31
         $post_id = null;
32
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
32
+        while ($all_posts->have_posts()) : $all_posts->the_post();
33 33
             $post_id = get_the_ID();
34 34
             global $post;
35
-            $post =  geodir_get_post_info($post_id);
35
+            $post = geodir_get_post_info($post_id);
36 36
             setup_postdata($post);
37 37
 
38 38
             $map_args = array();
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             ob_start();
56 56
             geodir_draw_map($map_args);
57 57
             $output = ob_get_clean();
58
-            $this->assertContains( 'geodir-map-detail-page', $output );
58
+            $this->assertContains('geodir-map-detail-page', $output);
59 59
         endwhile;
60 60
 
61 61
 
Please login to merge, or discard this patch.
tests/test-Favourites.php 2 patches
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -1,87 +1,87 @@
 block discarded – undo
1 1
 <?php
2 2
 class Favourites 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 testAddFavourite()
11
-    {
12
-        global $current_user;
10
+	public function testAddFavourite()
11
+	{
12
+		global $current_user;
13 13
 
14
-        $query_args = array(
15
-            'post_status' => 'publish',
16
-            'post_type' => 'gd_place',
17
-            'posts_per_page' => 1,
18
-        );
14
+		$query_args = array(
15
+			'post_status' => 'publish',
16
+			'post_type' => 'gd_place',
17
+			'posts_per_page' => 1,
18
+		);
19 19
 
20
-        $all_posts = new WP_Query( $query_args );
21
-        $post_id = null;
22
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
23
-            $post_id = get_the_ID();
24
-        endwhile;
20
+		$all_posts = new WP_Query( $query_args );
21
+		$post_id = null;
22
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
23
+			$post_id = get_the_ID();
24
+		endwhile;
25 25
 
26
-        $this->assertTrue(is_int($post_id));
26
+		$this->assertTrue(is_int($post_id));
27 27
 
28
-        ob_start();
29
-        geodir_add_to_favorite($post_id);
30
-        $output = ob_get_clean();
31
-        $this->assertContains( 'Remove from Favorites', $output );
28
+		ob_start();
29
+		geodir_add_to_favorite($post_id);
30
+		$output = ob_get_clean();
31
+		$this->assertContains( 'Remove from Favorites', $output );
32 32
 
33
-        $user_id = $current_user->ID;
33
+		$user_id = $current_user->ID;
34 34
 
35
-        $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
35
+		$user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
36 36
 
37
-        $this->assertContains( $post_id, $user_fav_posts );
37
+		$this->assertContains( $post_id, $user_fav_posts );
38 38
 
39 39
 
40
-    }
40
+	}
41 41
 
42
-    public function testRemoveFavourite()
43
-    {
44
-        global $current_user;
42
+	public function testRemoveFavourite()
43
+	{
44
+		global $current_user;
45 45
 
46
-        $query_args = array(
47
-            'post_status' => 'publish',
48
-            'post_type' => 'gd_place',
49
-            'posts_per_page' => 1,
50
-        );
46
+		$query_args = array(
47
+			'post_status' => 'publish',
48
+			'post_type' => 'gd_place',
49
+			'posts_per_page' => 1,
50
+		);
51 51
 
52
-        $all_posts = new WP_Query( $query_args );
53
-        $post_id = null;
54
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
55
-            $post_id = get_the_ID();
56
-        endwhile;
52
+		$all_posts = new WP_Query( $query_args );
53
+		$post_id = null;
54
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
55
+			$post_id = get_the_ID();
56
+		endwhile;
57 57
 
58
-        $this->assertTrue(is_int($post_id));
58
+		$this->assertTrue(is_int($post_id));
59 59
 
60
-        ob_start();
61
-        geodir_add_to_favorite($post_id);
62
-        $output = ob_get_clean();
63
-        $this->assertContains( 'Remove from Favorites', $output );
60
+		ob_start();
61
+		geodir_add_to_favorite($post_id);
62
+		$output = ob_get_clean();
63
+		$this->assertContains( 'Remove from Favorites', $output );
64 64
 
65
-        $user_id = $current_user->ID;
65
+		$user_id = $current_user->ID;
66 66
 
67
-        $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
67
+		$user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
68 68
 
69
-        $this->assertContains( $post_id, $user_fav_posts );
69
+		$this->assertContains( $post_id, $user_fav_posts );
70 70
 
71
-        ob_start();
72
-        geodir_remove_from_favorite($post_id);
73
-        $output = ob_get_clean();
74
-        $this->assertContains( 'Add to Favorites', $output );
71
+		ob_start();
72
+		geodir_remove_from_favorite($post_id);
73
+		$output = ob_get_clean();
74
+		$this->assertContains( 'Add to Favorites', $output );
75 75
 
76
-        $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
76
+		$user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
77 77
 
78
-        $this->assertNotContains( $post_id, $user_fav_posts );
79
-    }
78
+		$this->assertNotContains( $post_id, $user_fav_posts );
79
+	}
80 80
 
81 81
 
82
-    public function tearDown()
83
-    {
84
-        parent::tearDown();
85
-    }
82
+	public function tearDown()
83
+	{
84
+		parent::tearDown();
85
+	}
86 86
 }
87 87
 ?>
88 88
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
             'posts_per_page' => 1,
18 18
         );
19 19
 
20
-        $all_posts = new WP_Query( $query_args );
20
+        $all_posts = new WP_Query($query_args);
21 21
         $post_id = null;
22
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
22
+        while ($all_posts->have_posts()) : $all_posts->the_post();
23 23
             $post_id = get_the_ID();
24 24
         endwhile;
25 25
 
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
         ob_start();
29 29
         geodir_add_to_favorite($post_id);
30 30
         $output = ob_get_clean();
31
-        $this->assertContains( 'Remove from Favorites', $output );
31
+        $this->assertContains('Remove from Favorites', $output);
32 32
 
33 33
         $user_id = $current_user->ID;
34 34
 
35 35
         $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
36 36
 
37
-        $this->assertContains( $post_id, $user_fav_posts );
37
+        $this->assertContains($post_id, $user_fav_posts);
38 38
 
39 39
 
40 40
     }
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
             'posts_per_page' => 1,
50 50
         );
51 51
 
52
-        $all_posts = new WP_Query( $query_args );
52
+        $all_posts = new WP_Query($query_args);
53 53
         $post_id = null;
54
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
54
+        while ($all_posts->have_posts()) : $all_posts->the_post();
55 55
             $post_id = get_the_ID();
56 56
         endwhile;
57 57
 
@@ -60,22 +60,22 @@  discard block
 block discarded – undo
60 60
         ob_start();
61 61
         geodir_add_to_favorite($post_id);
62 62
         $output = ob_get_clean();
63
-        $this->assertContains( 'Remove from Favorites', $output );
63
+        $this->assertContains('Remove from Favorites', $output);
64 64
 
65 65
         $user_id = $current_user->ID;
66 66
 
67 67
         $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
68 68
 
69
-        $this->assertContains( $post_id, $user_fav_posts );
69
+        $this->assertContains($post_id, $user_fav_posts);
70 70
 
71 71
         ob_start();
72 72
         geodir_remove_from_favorite($post_id);
73 73
         $output = ob_get_clean();
74
-        $this->assertContains( 'Add to Favorites', $output );
74
+        $this->assertContains('Add to Favorites', $output);
75 75
 
76 76
         $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
77 77
 
78
-        $this->assertNotContains( $post_id, $user_fav_posts );
78
+        $this->assertNotContains($post_id, $user_fav_posts);
79 79
     }
80 80
 
81 81
 
Please login to merge, or discard this patch.
tests/test-Check_PinPoint.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
1 1
 <?php
2 2
 class CheckPinpoint extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+	}
8 8
 
9
-    public function testCheckPinpoint()
10
-    {
9
+	public function testCheckPinpoint()
10
+	{
11 11
 
12
-    }
12
+	}
13 13
 
14
-    public function tearDown()
15
-    {
16
-        parent::tearDown();
17
-    }
14
+	public function tearDown()
15
+	{
16
+		parent::tearDown();
17
+	}
18 18
 }
19 19
 ?>
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
tests/test-Add_A_Review.php 1 patch
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -1,63 +1,63 @@
 block discarded – undo
1 1
 <?php
2 2
 class AddReview 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 testAddReview()
11
-    {
12
-        $time = current_time('mysql');
10
+	public function testAddReview()
11
+	{
12
+		$time = current_time('mysql');
13 13
 
14
-        $args = array(
15
-            'listing_type' => 'gd_place',
16
-            'post_title' => 'Test Listing Title',
17
-            'post_desc' => 'Test Desc',
18
-            'post_tags' => 'test1,test2',
19
-            'post_address' => 'New York City Hall',
20
-            'post_zip' => '10007',
21
-            'post_latitude' => '40.7127837',
22
-            'post_longitude' => '-74.00594130000002',
23
-            'post_mapview' => 'ROADMAP',
24
-            'post_mapzoom' => '10',
25
-            'geodir_timing' => '10.00 am to 6 pm every day',
26
-            'geodir_contact' => '1234567890',
27
-            'geodir_email' => '[email protected]',
28
-            'geodir_website' => 'http://test.com',
29
-            'geodir_twitter' => 'http://twitter.com/test',
30
-            'geodir_facebook' => 'http://facebook.com/test',
31
-            'geodir_special_offers' => 'Test offer'
32
-        );
33
-        $post_id = geodir_save_listing($args, true);
14
+		$args = array(
15
+			'listing_type' => 'gd_place',
16
+			'post_title' => 'Test Listing Title',
17
+			'post_desc' => 'Test Desc',
18
+			'post_tags' => 'test1,test2',
19
+			'post_address' => 'New York City Hall',
20
+			'post_zip' => '10007',
21
+			'post_latitude' => '40.7127837',
22
+			'post_longitude' => '-74.00594130000002',
23
+			'post_mapview' => 'ROADMAP',
24
+			'post_mapzoom' => '10',
25
+			'geodir_timing' => '10.00 am to 6 pm every day',
26
+			'geodir_contact' => '1234567890',
27
+			'geodir_email' => '[email protected]',
28
+			'geodir_website' => 'http://test.com',
29
+			'geodir_twitter' => 'http://twitter.com/test',
30
+			'geodir_facebook' => 'http://facebook.com/test',
31
+			'geodir_special_offers' => 'Test offer'
32
+		);
33
+		$post_id = geodir_save_listing($args, true);
34 34
 
35
-        $data = array(
36
-            'comment_post_ID' => $post_id,
37
-            'comment_author' => 'admin',
38
-            'comment_author_email' => '[email protected]',
39
-            'comment_author_url' => 'http://wpgeodirectory.com',
40
-            'comment_content' => 'content here',
41
-            'comment_type' => '',
42
-            'comment_parent' => 0,
43
-            'user_id' => 1,
44
-            'comment_author_IP' => '127.0.0.1',
45
-            '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)',
46
-            'comment_date' => $time,
47
-            'comment_approved' => 1,
48
-        );
35
+		$data = array(
36
+			'comment_post_ID' => $post_id,
37
+			'comment_author' => 'admin',
38
+			'comment_author_email' => '[email protected]',
39
+			'comment_author_url' => 'http://wpgeodirectory.com',
40
+			'comment_content' => 'content here',
41
+			'comment_type' => '',
42
+			'comment_parent' => 0,
43
+			'user_id' => 1,
44
+			'comment_author_IP' => '127.0.0.1',
45
+			'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)',
46
+			'comment_date' => $time,
47
+			'comment_approved' => 1,
48
+		);
49 49
 
50
-        $comment_id = wp_insert_comment($data);
50
+		$comment_id = wp_insert_comment($data);
51 51
 
52
-        $_REQUEST['geodir_overallrating'] = 5.0;
53
-        geodir_save_rating($comment_id);
52
+		$_REQUEST['geodir_overallrating'] = 5.0;
53
+		geodir_save_rating($comment_id);
54 54
 
55
-        $this->assertTrue(is_int($comment_id));
56
-    }
55
+		$this->assertTrue(is_int($comment_id));
56
+	}
57 57
 
58
-    public function tearDown()
59
-    {
60
-        parent::tearDown();
61
-    }
58
+	public function tearDown()
59
+	{
60
+		parent::tearDown();
61
+	}
62 62
 }
63 63
 ?>
64 64
\ No newline at end of file
Please login to merge, or discard this patch.
tests/test-Send_Enquiry.php 2 patches
Indentation   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -1,116 +1,116 @@
 block discarded – undo
1 1
 <?php
2 2
 class SendEnquiry extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-    }
8
-
9
-    public function testSendEnquiry()
10
-    {
11
-        $query_args = array(
12
-            'post_status' => 'publish',
13
-            'post_type' => 'gd_place',
14
-            'posts_per_page' => 1,
15
-        );
16
-
17
-        $all_posts = new WP_Query( $query_args );
18
-        $post_id = null;
19
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
20
-            $post_id = get_the_ID();
21
-        endwhile;
22
-
23
-        $this->assertTrue(is_int($post_id));
24
-
25
-        $data = array(
26
-            'sendact' => 'send_inqury',
27
-            'pid' => (string) $post_id,
28
-            'inq_name' => 'Test User',
29
-            'inq_email' => '[email protected]',
30
-            'inq_phone' => 'Test',
31
-            'inq_msg' => 'Hi there, I would like to enquire about this place. I would like to ask more info about...',
32
-            'Send' => 'Send'
33
-        );
34
-
35
-        add_filter('wp_redirect', '__return_false');
36
-        geodir_send_inquiry($data);
37
-        remove_filter('wp_redirect', '__return_false');
38
-    }
39
-
40
-    public function testSendToFriend()
41
-    {
42
-        $query_args = array(
43
-            'post_status' => 'publish',
44
-            'post_type' => 'gd_place',
45
-            'posts_per_page' => 1,
46
-        );
47
-
48
-        $all_posts = new WP_Query( $query_args );
49
-        $post_id = null;
50
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
51
-            $post_id = get_the_ID();
52
-        endwhile;
53
-
54
-        $this->assertTrue(is_int($post_id));
55
-
56
-        $data = array(
57
-            'sendact' => 'email_frnd',
58
-            'pid' => (string) $post_id,
59
-            'yourname' => 'Test User',
60
-            'youremail' => '[email protected]',
61
-            'frnd_subject' => 'Test',
62
-            'frnd_comments' => 'Hi there, This is a comment',
63
-            'to_email' => '[email protected]',
64
-            'to_name' => 'Test User 2',
65
-            'Send' => 'Send'
66
-        );
67
-
68
-        add_filter('wp_redirect', '__return_false');
69
-        geodir_send_friend($data);
70
-        remove_filter('wp_redirect', '__return_false');
71
-    }
72
-
73
-    public function texstSendToFriendFailure()
74
-    {
75
-        $query_args = array(
76
-            'post_status' => 'publish',
77
-            'post_type' => 'gd_place',
78
-            'posts_per_page' => 1,
79
-        );
80
-
81
-        $all_posts = new WP_Query( $query_args );
82
-        $post_id = null;
83
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
84
-            $post_id = get_the_ID();
85
-        endwhile;
86
-
87
-        $this->assertTrue(is_int($post_id));
88
-
89
-        $data = array(
90
-            'sendact' => 'email_frnd',
91
-            'pid' => (string) $post_id,
92
-            'yourname' => 'Test User',
93
-            'youremail' => '[email protected]',
94
-            'frnd_subject' => 'Test',
95
-            'frnd_comments' => 'Hi there, This is a comment',
96
-            'to_email' => 'Test User 2', //incorrect email
97
-            'to_name' => '[email protected]',
98
-            'Send' => 'Send'
99
-        );
100
-
101
-        add_filter('wp_redirect', '__return_false');
102
-        add_filter('wp_mail', 'print_mail');
103
-        ob_start();
104
-        geodir_send_friend($data);
105
-        $output = ob_get_clean();
106
-        $this->assertContains( 'Email from GeoDirectory failed to send', $output );
107
-        remove_filter('wp_mail', 'print_mail');
108
-        remove_filter('wp_redirect', '__return_false');
109
-    }
110
-
111
-    public function tearDown()
112
-    {
113
-        parent::tearDown();
114
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+	}
8
+
9
+	public function testSendEnquiry()
10
+	{
11
+		$query_args = array(
12
+			'post_status' => 'publish',
13
+			'post_type' => 'gd_place',
14
+			'posts_per_page' => 1,
15
+		);
16
+
17
+		$all_posts = new WP_Query( $query_args );
18
+		$post_id = null;
19
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
20
+			$post_id = get_the_ID();
21
+		endwhile;
22
+
23
+		$this->assertTrue(is_int($post_id));
24
+
25
+		$data = array(
26
+			'sendact' => 'send_inqury',
27
+			'pid' => (string) $post_id,
28
+			'inq_name' => 'Test User',
29
+			'inq_email' => '[email protected]',
30
+			'inq_phone' => 'Test',
31
+			'inq_msg' => 'Hi there, I would like to enquire about this place. I would like to ask more info about...',
32
+			'Send' => 'Send'
33
+		);
34
+
35
+		add_filter('wp_redirect', '__return_false');
36
+		geodir_send_inquiry($data);
37
+		remove_filter('wp_redirect', '__return_false');
38
+	}
39
+
40
+	public function testSendToFriend()
41
+	{
42
+		$query_args = array(
43
+			'post_status' => 'publish',
44
+			'post_type' => 'gd_place',
45
+			'posts_per_page' => 1,
46
+		);
47
+
48
+		$all_posts = new WP_Query( $query_args );
49
+		$post_id = null;
50
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
51
+			$post_id = get_the_ID();
52
+		endwhile;
53
+
54
+		$this->assertTrue(is_int($post_id));
55
+
56
+		$data = array(
57
+			'sendact' => 'email_frnd',
58
+			'pid' => (string) $post_id,
59
+			'yourname' => 'Test User',
60
+			'youremail' => '[email protected]',
61
+			'frnd_subject' => 'Test',
62
+			'frnd_comments' => 'Hi there, This is a comment',
63
+			'to_email' => '[email protected]',
64
+			'to_name' => 'Test User 2',
65
+			'Send' => 'Send'
66
+		);
67
+
68
+		add_filter('wp_redirect', '__return_false');
69
+		geodir_send_friend($data);
70
+		remove_filter('wp_redirect', '__return_false');
71
+	}
72
+
73
+	public function texstSendToFriendFailure()
74
+	{
75
+		$query_args = array(
76
+			'post_status' => 'publish',
77
+			'post_type' => 'gd_place',
78
+			'posts_per_page' => 1,
79
+		);
80
+
81
+		$all_posts = new WP_Query( $query_args );
82
+		$post_id = null;
83
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
84
+			$post_id = get_the_ID();
85
+		endwhile;
86
+
87
+		$this->assertTrue(is_int($post_id));
88
+
89
+		$data = array(
90
+			'sendact' => 'email_frnd',
91
+			'pid' => (string) $post_id,
92
+			'yourname' => 'Test User',
93
+			'youremail' => '[email protected]',
94
+			'frnd_subject' => 'Test',
95
+			'frnd_comments' => 'Hi there, This is a comment',
96
+			'to_email' => 'Test User 2', //incorrect email
97
+			'to_name' => '[email protected]',
98
+			'Send' => 'Send'
99
+		);
100
+
101
+		add_filter('wp_redirect', '__return_false');
102
+		add_filter('wp_mail', 'print_mail');
103
+		ob_start();
104
+		geodir_send_friend($data);
105
+		$output = ob_get_clean();
106
+		$this->assertContains( 'Email from GeoDirectory failed to send', $output );
107
+		remove_filter('wp_mail', 'print_mail');
108
+		remove_filter('wp_redirect', '__return_false');
109
+	}
110
+
111
+	public function tearDown()
112
+	{
113
+		parent::tearDown();
114
+	}
115 115
 }
116 116
 ?>
117 117
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@  discard block
 block discarded – undo
14 14
             'posts_per_page' => 1,
15 15
         );
16 16
 
17
-        $all_posts = new WP_Query( $query_args );
17
+        $all_posts = new WP_Query($query_args);
18 18
         $post_id = null;
19
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
19
+        while ($all_posts->have_posts()) : $all_posts->the_post();
20 20
             $post_id = get_the_ID();
21 21
         endwhile;
22 22
 
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
             'posts_per_page' => 1,
46 46
         );
47 47
 
48
-        $all_posts = new WP_Query( $query_args );
48
+        $all_posts = new WP_Query($query_args);
49 49
         $post_id = null;
50
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
50
+        while ($all_posts->have_posts()) : $all_posts->the_post();
51 51
             $post_id = get_the_ID();
52 52
         endwhile;
53 53
 
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
             'posts_per_page' => 1,
79 79
         );
80 80
 
81
-        $all_posts = new WP_Query( $query_args );
81
+        $all_posts = new WP_Query($query_args);
82 82
         $post_id = null;
83
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
83
+        while ($all_posts->have_posts()) : $all_posts->the_post();
84 84
             $post_id = get_the_ID();
85 85
         endwhile;
86 86
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         ob_start();
104 104
         geodir_send_friend($data);
105 105
         $output = ob_get_clean();
106
-        $this->assertContains( 'Email from GeoDirectory failed to send', $output );
106
+        $this->assertContains('Email from GeoDirectory failed to send', $output);
107 107
         remove_filter('wp_mail', 'print_mail');
108 108
         remove_filter('wp_redirect', '__return_false');
109 109
     }
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,41 +3,41 @@  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( 'GD_USE_PHP_SESSIONS', false );
7
-define( 'GD_TESTING_MODE', true );
6
+define('GD_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
-if ( ! $_tests_dir ) {
12
-	$_tests_dir = dirname( __FILE__ )  . '/lib/wordpress-tests-lib';
11
+if (!$_tests_dir) {
12
+	$_tests_dir = dirname(__FILE__) . '/lib/wordpress-tests-lib';
13 13
 }
14 14
 
15 15
 require_once $_tests_dir . '/includes/functions.php';
16 16
 
17 17
 function _manually_load_plugin() {
18
-	require dirname( __FILE__ ) . '/../geodirectory.php';
18
+	require dirname(__FILE__) . '/../geodirectory.php';
19 19
 }
20
-tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
20
+tests_add_filter('muplugins_loaded', '_manually_load_plugin');
21 21
 
22 22
 function place_dummy_image_url($url) {
23
-	$gd_dummy_base_url = getenv( 'GD_DUMMY_BASE_URL' );
23
+	$gd_dummy_base_url = getenv('GD_DUMMY_BASE_URL');
24 24
 	if ($gd_dummy_base_url) {
25 25
 		return $gd_dummy_base_url;
26 26
 	} else {
27 27
 		return $url;
28 28
 	}
29 29
 }
30
-tests_add_filter( 'place_dummy_image_url', 'place_dummy_image_url' );
30
+tests_add_filter('place_dummy_image_url', 'place_dummy_image_url');
31 31
 
32 32
 function place_dummy_cat_image_url($url) {
33
-	$gd_dummy_base_url = getenv( 'GD_DUMMY_BASE_URL' );
33
+	$gd_dummy_base_url = getenv('GD_DUMMY_BASE_URL');
34 34
 	if ($gd_dummy_base_url) {
35
-		return $gd_dummy_base_url."/cat_icon";
35
+		return $gd_dummy_base_url . "/cat_icon";
36 36
 	} else {
37 37
 		return $url;
38 38
 	}
39 39
 }
40
-tests_add_filter( 'place_dummy_cat_image_url', 'place_dummy_cat_image_url' );
40
+tests_add_filter('place_dummy_cat_image_url', 'place_dummy_cat_image_url');
41 41
 
42 42
 
43 43
 require $_tests_dir . '/includes/bootstrap.php';
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
 global $current_user;
46 46
 $current_user = new WP_User(1);
47 47
 $current_user->set_role('administrator');
48
-wp_update_user( array( 'ID' => 1, 'first_name' => 'Admin', 'last_name' => 'User' ) );
48
+wp_update_user(array('ID' => 1, 'first_name' => 'Admin', 'last_name' => 'User'));
49 49
 //Add subscriber
50
-wp_create_user( 'testuser', '12345', '[email protected]' );
50
+wp_create_user('testuser', '12345', '[email protected]');
51 51
 
52 52
 echo "Activating GeoDirectory...\n";
53
-activate_plugin( 'geodirectory/geodirectory.php' );
53
+activate_plugin('geodirectory/geodirectory.php');
54 54
 
55 55
 echo "Installing GeoDirectory...\n";
56 56
 geodir_install();
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 //	unset($_REQUEST['_wpnonce']);
122 122
 
123 123
 	$i = 2;
124
-	while($i <= $max) {
124
+	while ($i <= $max) {
125 125
 		global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
126 126
 
127 127
 		$dummy_post_index = $i;
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		$city_bound_lat2 = 40.91525559999999;
131 131
 		$city_bound_lng2 = -73.7002721;
132 132
 
133
-		include dirname( __FILE__ ) . '/../geodirectory-admin/place_dummy_post.php';
133
+		include dirname(__FILE__) . '/../geodirectory-admin/place_dummy_post.php';
134 134
 		$i++;
135 135
 	}
136 136
 }
Please login to merge, or discard this patch.
tests/test-Author_Page.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
1 1
 <?php
2 2
 class AuthorPage extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+	}
8 8
 
9
-    public function testAuthorPage()
10
-    {
9
+	public function testAuthorPage()
10
+	{
11 11
 
12
-    }
12
+	}
13 13
 
14
-    public function tearDown()
15
-    {
16
-        parent::tearDown();
17
-    }
14
+	public function tearDown()
15
+	{
16
+		parent::tearDown();
17
+	}
18 18
 }
19 19
 ?>
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
tests/lib/wordpress-tests-lib/wp-tests-config.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /* Path to the WordPress codebase you'd like to test. Add a backslash in the end. */
4
-define( 'ABSPATH', getenv( 'WP_CORE_DIR' ) . '/' );
4
+define('ABSPATH', getenv('WP_CORE_DIR') . '/');
5 5
 
6 6
 // Test with multisite enabled
7
-define( 'WP_TESTS_MULTISITE', (bool) getenv( 'WP_MULTISITE' ) );
7
+define('WP_TESTS_MULTISITE', (bool) getenv('WP_MULTISITE'));
8 8
 
9 9
 // Force known bugs
10 10
 // define( 'WP_TESTS_FORCE_KNOWN_BUGS', true );
11 11
 
12 12
 // Test with WordPress debug mode on
13
-define( 'WP_DEBUG', true );
13
+define('WP_DEBUG', true);
14 14
 
15 15
 // ** MySQL settings ** //
16 16
 
@@ -21,18 +21,18 @@  discard block
 block discarded – undo
21 21
 // These tests will DROP ALL TABLES in the database with the prefix named below.
22 22
 // DO NOT use a production database or one that is shared with something else.
23 23
 
24
-define( 'DB_NAME', 'wordpress_test' );
25
-define( 'DB_USER', 'root' );
26
-define( 'DB_PASSWORD', 'root' );
27
-define( 'DB_HOST', 'localhost' );
28
-define( 'DB_CHARSET', 'utf8' );
29
-define( 'DB_COLLATE', '' );
24
+define('DB_NAME', 'wordpress_test');
25
+define('DB_USER', 'root');
26
+define('DB_PASSWORD', 'root');
27
+define('DB_HOST', 'localhost');
28
+define('DB_CHARSET', 'utf8');
29
+define('DB_COLLATE', '');
30 30
 
31
-define( 'WP_TESTS_DOMAIN', 'example.org' );
32
-define( 'WP_TESTS_EMAIL', '[email protected]' );
33
-define( 'WP_TESTS_TITLE', 'Test Blog' );
31
+define('WP_TESTS_DOMAIN', 'example.org');
32
+define('WP_TESTS_EMAIL', '[email protected]');
33
+define('WP_TESTS_TITLE', 'Test Blog');
34 34
 
35
-define( 'WP_PHP_BINARY', 'php' );
35
+define('WP_PHP_BINARY', 'php');
36 36
 
37
-define( 'WPLANG', '' );
38
-$table_prefix  = 'wptests_';
39 37
\ No newline at end of file
38
+define('WPLANG', '');
39
+$table_prefix = 'wptests_';
40 40
\ No newline at end of file
Please login to merge, or discard this patch.