Passed
Pull Request — master (#229)
by Kiran
12:59
created
tests/test-Check_Login_Box.php 2 patches
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -1,57 +1,57 @@
 block discarded – undo
1 1
 <?php
2 2
 class CheckLoginBox 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 testLoginBoxEmptyPassword()
10
-    {
11
-        global $errors;
12
-        $_POST['testcookie'] = 1;
13
-        $_POST['log'] = 'admin';
14
-        add_filter('wp_redirect', '__return_false');
15
-        geodir_user_signup();
16
-        remove_filter('wp_redirect', '__return_false');
17
-        $errors = (array) $errors;
18
-        $this->assertArrayHasKey( 'empty_password', $errors["errors"] );
19
-        $this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] );
20
-    }
9
+	public function testLoginBoxEmptyPassword()
10
+	{
11
+		global $errors;
12
+		$_POST['testcookie'] = 1;
13
+		$_POST['log'] = 'admin';
14
+		add_filter('wp_redirect', '__return_false');
15
+		geodir_user_signup();
16
+		remove_filter('wp_redirect', '__return_false');
17
+		$errors = (array) $errors;
18
+		$this->assertArrayHasKey( 'empty_password', $errors["errors"] );
19
+		$this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] );
20
+	}
21 21
 
22
-    public function testLoginBoxIncorrectPassword()
23
-    {
24
-        global $errors;
25
-        $_POST['testcookie'] = 1;
26
-        $_REQUEST['action'] = 'login';
27
-        $_POST['log'] = 'testuser';
28
-        $_POST['pwd'] = 'admin';
29
-        add_filter('wp_redirect', '__return_false');
30
-        geodir_user_signup();
31
-        remove_filter('wp_redirect', '__return_false');
32
-        $errors = (array) $errors;
33
-        $this->assertArrayHasKey( 'incorrect_password', $errors["errors"] );
34
-        $this->assertContains( 'The password you entered for the username', $errors["errors"]["incorrect_password"][0] );
35
-    }
22
+	public function testLoginBoxIncorrectPassword()
23
+	{
24
+		global $errors;
25
+		$_POST['testcookie'] = 1;
26
+		$_REQUEST['action'] = 'login';
27
+		$_POST['log'] = 'testuser';
28
+		$_POST['pwd'] = 'admin';
29
+		add_filter('wp_redirect', '__return_false');
30
+		geodir_user_signup();
31
+		remove_filter('wp_redirect', '__return_false');
32
+		$errors = (array) $errors;
33
+		$this->assertArrayHasKey( 'incorrect_password', $errors["errors"] );
34
+		$this->assertContains( 'The password you entered for the username', $errors["errors"]["incorrect_password"][0] );
35
+	}
36 36
 
37
-    public function testLoginBoxInvalidUsername()
38
-    {
39
-        global $errors;
40
-        $_POST['testcookie'] = 1;
41
-        $_REQUEST['action'] = 'login';
42
-        $_POST['log'] = 'adm##@in';
43
-        $_POST['pwd'] = 'admin';
44
-        add_filter('wp_redirect', '__return_false');
45
-        geodir_user_signup();
46
-        remove_filter('wp_redirect', '__return_false');
47
-        $errors = (array) $errors;
48
-        $this->assertArrayHasKey( 'invalid_username', $errors["errors"] );
49
-        $this->assertContains( 'Invalid username', $errors["errors"]["invalid_username"][0] );
50
-    }
37
+	public function testLoginBoxInvalidUsername()
38
+	{
39
+		global $errors;
40
+		$_POST['testcookie'] = 1;
41
+		$_REQUEST['action'] = 'login';
42
+		$_POST['log'] = 'adm##@in';
43
+		$_POST['pwd'] = 'admin';
44
+		add_filter('wp_redirect', '__return_false');
45
+		geodir_user_signup();
46
+		remove_filter('wp_redirect', '__return_false');
47
+		$errors = (array) $errors;
48
+		$this->assertArrayHasKey( 'invalid_username', $errors["errors"] );
49
+		$this->assertContains( 'Invalid username', $errors["errors"]["invalid_username"][0] );
50
+	}
51 51
 
52
-    public function tearDown()
53
-    {
54
-        parent::tearDown();
55
-    }
52
+	public function tearDown()
53
+	{
54
+		parent::tearDown();
55
+	}
56 56
 }
57 57
 ?>
58 58
\ 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
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
         geodir_user_signup();
16 16
         remove_filter('wp_redirect', '__return_false');
17 17
         $errors = (array) $errors;
18
-        $this->assertArrayHasKey( 'empty_password', $errors["errors"] );
19
-        $this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] );
18
+        $this->assertArrayHasKey('empty_password', $errors["errors"]);
19
+        $this->assertContains('The password field is empty', $errors["errors"]["empty_password"][0]);
20 20
     }
21 21
 
22 22
     public function testLoginBoxIncorrectPassword()
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
         geodir_user_signup();
31 31
         remove_filter('wp_redirect', '__return_false');
32 32
         $errors = (array) $errors;
33
-        $this->assertArrayHasKey( 'incorrect_password', $errors["errors"] );
34
-        $this->assertContains( 'The password you entered for the username', $errors["errors"]["incorrect_password"][0] );
33
+        $this->assertArrayHasKey('incorrect_password', $errors["errors"]);
34
+        $this->assertContains('The password you entered for the username', $errors["errors"]["incorrect_password"][0]);
35 35
     }
36 36
 
37 37
     public function testLoginBoxInvalidUsername()
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
         geodir_user_signup();
46 46
         remove_filter('wp_redirect', '__return_false');
47 47
         $errors = (array) $errors;
48
-        $this->assertArrayHasKey( 'invalid_username', $errors["errors"] );
49
-        $this->assertContains( 'Invalid username', $errors["errors"]["invalid_username"][0] );
48
+        $this->assertArrayHasKey('invalid_username', $errors["errors"]);
49
+        $this->assertContains('Invalid username', $errors["errors"]["invalid_username"][0]);
50 50
     }
51 51
 
52 52
     public function tearDown()
Please login to merge, or discard this patch.
tests/test-Login.php 2 patches
Indentation   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -1,52 +1,52 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 class LoginUser extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        deactivate_plugins('buddypress/bp-loader.php');
8
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		deactivate_plugins('buddypress/bp-loader.php');
8
+	}
9 9
 
10
-    public function testLoginEmptyPassword()
11
-    {
12
-        global $errors;
13
-        $_REQUEST['action'] = 'login';
14
-        $_POST['log'] = 'admin';
15
-        add_filter('wp_redirect', '__return_false');
16
-        geodir_user_signup();
17
-        remove_filter('wp_redirect', '__return_false');
18
-        $errors = (array) $errors;
19
-        $this->assertArrayHasKey( 'empty_password', $errors["errors"] );
20
-        $this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] );
21
-    }
10
+	public function testLoginEmptyPassword()
11
+	{
12
+		global $errors;
13
+		$_REQUEST['action'] = 'login';
14
+		$_POST['log'] = 'admin';
15
+		add_filter('wp_redirect', '__return_false');
16
+		geodir_user_signup();
17
+		remove_filter('wp_redirect', '__return_false');
18
+		$errors = (array) $errors;
19
+		$this->assertArrayHasKey( 'empty_password', $errors["errors"] );
20
+		$this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] );
21
+	}
22 22
 
23
-    public function testLoginIncorrectPassword()
24
-    {
25
-        global $errors;
26
-        $_REQUEST['action'] = 'login';
27
-        $_POST['log'] = 'testuser';
28
-        $_POST['pwd'] = 'admin';
29
-        add_filter('wp_redirect', '__return_false');
30
-        geodir_user_signup();
31
-        remove_filter('wp_redirect', '__return_false');
32
-        $errors = (array) $errors;
33
-        $this->assertArrayHasKey( 'incorrect_password', $errors["errors"] );
34
-        $this->assertContains( 'The password you entered for the username', $errors["errors"]["incorrect_password"][0] );
35
-    }
23
+	public function testLoginIncorrectPassword()
24
+	{
25
+		global $errors;
26
+		$_REQUEST['action'] = 'login';
27
+		$_POST['log'] = 'testuser';
28
+		$_POST['pwd'] = 'admin';
29
+		add_filter('wp_redirect', '__return_false');
30
+		geodir_user_signup();
31
+		remove_filter('wp_redirect', '__return_false');
32
+		$errors = (array) $errors;
33
+		$this->assertArrayHasKey( 'incorrect_password', $errors["errors"] );
34
+		$this->assertContains( 'The password you entered for the username', $errors["errors"]["incorrect_password"][0] );
35
+	}
36 36
 
37
-    public function testLoginInvalidUsername()
38
-    {
39
-        global $errors;
40
-        $_REQUEST['action'] = 'login';
41
-        $_POST['log'] = 'adm##@in';
42
-        $_POST['pwd'] = 'admin';
43
-        add_filter('wp_redirect', '__return_false');
44
-        geodir_user_signup();
45
-        remove_filter('wp_redirect', '__return_false');
46
-        $errors = (array) $errors;
47
-        $this->assertArrayHasKey( 'invalid_username', $errors["errors"] );
48
-        $this->assertContains( 'Invalid username', $errors["errors"]["invalid_username"][0] );
49
-    }
37
+	public function testLoginInvalidUsername()
38
+	{
39
+		global $errors;
40
+		$_REQUEST['action'] = 'login';
41
+		$_POST['log'] = 'adm##@in';
42
+		$_POST['pwd'] = 'admin';
43
+		add_filter('wp_redirect', '__return_false');
44
+		geodir_user_signup();
45
+		remove_filter('wp_redirect', '__return_false');
46
+		$errors = (array) $errors;
47
+		$this->assertArrayHasKey( 'invalid_username', $errors["errors"] );
48
+		$this->assertContains( 'Invalid username', $errors["errors"]["invalid_username"][0] );
49
+	}
50 50
 
51 51
 //    public function testLoginValid()
52 52
 //    {
@@ -59,55 +59,55 @@  discard block
 block discarded – undo
59 59
 //        remove_filter('wp_redirect', '__return_false');
60 60
 //    }
61 61
 
62
-    public function testForgotPassEmptyData()
63
-    {
64
-        global $errors;
65
-        $_SERVER['REQUEST_METHOD'] = 'POST';
66
-        $_REQUEST['action'] = 'retrievepassword';
67
-        $_POST['user_login'] = '';
68
-        $_POST['user_email'] = '';
69
-        add_filter('wp_redirect', '__return_false');
70
-        geodir_user_signup();
71
-        remove_filter('wp_redirect', '__return_false');
72
-        $errors = (array) $errors;
73
-        $this->assertArrayHasKey( 'empty_username', $errors["errors"] );
74
-        $this->assertContains( 'Enter a username or e-mail address', $errors["errors"]["empty_username"][0] );
75
-    }
62
+	public function testForgotPassEmptyData()
63
+	{
64
+		global $errors;
65
+		$_SERVER['REQUEST_METHOD'] = 'POST';
66
+		$_REQUEST['action'] = 'retrievepassword';
67
+		$_POST['user_login'] = '';
68
+		$_POST['user_email'] = '';
69
+		add_filter('wp_redirect', '__return_false');
70
+		geodir_user_signup();
71
+		remove_filter('wp_redirect', '__return_false');
72
+		$errors = (array) $errors;
73
+		$this->assertArrayHasKey( 'empty_username', $errors["errors"] );
74
+		$this->assertContains( 'Enter a username or e-mail address', $errors["errors"]["empty_username"][0] );
75
+	}
76 76
 
77
-    public function testForgotPassInvalidEmail()
78
-    {
79
-        global $errors;
80
-        $_SERVER['REQUEST_METHOD'] = 'POST';
81
-        $_REQUEST['action'] = 'retrievepassword';
82
-        $_POST['user_login'] = '[email protected]';
83
-        $_POST['user_email'] = '';
84
-        add_filter('wp_redirect', '__return_false');
85
-        geodir_user_signup();
86
-        remove_filter('wp_redirect', '__return_false');
87
-        $errors = (array) $errors;
88
-        $this->assertArrayHasKey( 'invalid_email', $errors["errors"] );
89
-        $this->assertContains( 'There is no user registered with that email address', $errors["errors"]["invalid_email"][0] );
90
-    }
77
+	public function testForgotPassInvalidEmail()
78
+	{
79
+		global $errors;
80
+		$_SERVER['REQUEST_METHOD'] = 'POST';
81
+		$_REQUEST['action'] = 'retrievepassword';
82
+		$_POST['user_login'] = '[email protected]';
83
+		$_POST['user_email'] = '';
84
+		add_filter('wp_redirect', '__return_false');
85
+		geodir_user_signup();
86
+		remove_filter('wp_redirect', '__return_false');
87
+		$errors = (array) $errors;
88
+		$this->assertArrayHasKey( 'invalid_email', $errors["errors"] );
89
+		$this->assertContains( 'There is no user registered with that email address', $errors["errors"]["invalid_email"][0] );
90
+	}
91 91
 
92
-    public function testForgotPassInvalidUsername()
93
-    {
94
-        global $errors;
95
-        $_SERVER['REQUEST_METHOD'] = 'POST';
96
-        $_REQUEST['action'] = 'retrievepassword';
97
-        $_POST['user_login'] = 'holla';
98
-        $_POST['user_email'] = '[email protected]';
99
-        add_filter('wp_redirect', '__return_false');
100
-        geodir_user_signup();
101
-        remove_filter('wp_redirect', '__return_false');
102
-        $errors = (array) $errors;
103
-        $this->assertArrayHasKey( 'invalidcombo', $errors["errors"] );
104
-        $this->assertContains( 'Invalid username or e-mail', $errors["errors"]["invalidcombo"][0] );
105
-    }
92
+	public function testForgotPassInvalidUsername()
93
+	{
94
+		global $errors;
95
+		$_SERVER['REQUEST_METHOD'] = 'POST';
96
+		$_REQUEST['action'] = 'retrievepassword';
97
+		$_POST['user_login'] = 'holla';
98
+		$_POST['user_email'] = '[email protected]';
99
+		add_filter('wp_redirect', '__return_false');
100
+		geodir_user_signup();
101
+		remove_filter('wp_redirect', '__return_false');
102
+		$errors = (array) $errors;
103
+		$this->assertArrayHasKey( 'invalidcombo', $errors["errors"] );
104
+		$this->assertContains( 'Invalid username or e-mail', $errors["errors"]["invalidcombo"][0] );
105
+	}
106 106
 
107
-    public function tearDown()
108
-    {
109
-        parent::tearDown();
110
-    }
107
+	public function tearDown()
108
+	{
109
+		parent::tearDown();
110
+	}
111 111
 
112 112
 }
113 113
 ?>
114 114
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
         geodir_user_signup();
17 17
         remove_filter('wp_redirect', '__return_false');
18 18
         $errors = (array) $errors;
19
-        $this->assertArrayHasKey( 'empty_password', $errors["errors"] );
20
-        $this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] );
19
+        $this->assertArrayHasKey('empty_password', $errors["errors"]);
20
+        $this->assertContains('The password field is empty', $errors["errors"]["empty_password"][0]);
21 21
     }
22 22
 
23 23
     public function testLoginIncorrectPassword()
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
         geodir_user_signup();
31 31
         remove_filter('wp_redirect', '__return_false');
32 32
         $errors = (array) $errors;
33
-        $this->assertArrayHasKey( 'incorrect_password', $errors["errors"] );
34
-        $this->assertContains( 'The password you entered for the username', $errors["errors"]["incorrect_password"][0] );
33
+        $this->assertArrayHasKey('incorrect_password', $errors["errors"]);
34
+        $this->assertContains('The password you entered for the username', $errors["errors"]["incorrect_password"][0]);
35 35
     }
36 36
 
37 37
     public function testLoginInvalidUsername()
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
         geodir_user_signup();
45 45
         remove_filter('wp_redirect', '__return_false');
46 46
         $errors = (array) $errors;
47
-        $this->assertArrayHasKey( 'invalid_username', $errors["errors"] );
48
-        $this->assertContains( 'Invalid username', $errors["errors"]["invalid_username"][0] );
47
+        $this->assertArrayHasKey('invalid_username', $errors["errors"]);
48
+        $this->assertContains('Invalid username', $errors["errors"]["invalid_username"][0]);
49 49
     }
50 50
 
51 51
 //    public function testLoginValid()
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
         geodir_user_signup();
71 71
         remove_filter('wp_redirect', '__return_false');
72 72
         $errors = (array) $errors;
73
-        $this->assertArrayHasKey( 'empty_username', $errors["errors"] );
74
-        $this->assertContains( 'Enter a username or e-mail address', $errors["errors"]["empty_username"][0] );
73
+        $this->assertArrayHasKey('empty_username', $errors["errors"]);
74
+        $this->assertContains('Enter a username or e-mail address', $errors["errors"]["empty_username"][0]);
75 75
     }
76 76
 
77 77
     public function testForgotPassInvalidEmail()
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
         geodir_user_signup();
86 86
         remove_filter('wp_redirect', '__return_false');
87 87
         $errors = (array) $errors;
88
-        $this->assertArrayHasKey( 'invalid_email', $errors["errors"] );
89
-        $this->assertContains( 'There is no user registered with that email address', $errors["errors"]["invalid_email"][0] );
88
+        $this->assertArrayHasKey('invalid_email', $errors["errors"]);
89
+        $this->assertContains('There is no user registered with that email address', $errors["errors"]["invalid_email"][0]);
90 90
     }
91 91
 
92 92
     public function testForgotPassInvalidUsername()
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
         geodir_user_signup();
101 101
         remove_filter('wp_redirect', '__return_false');
102 102
         $errors = (array) $errors;
103
-        $this->assertArrayHasKey( 'invalidcombo', $errors["errors"] );
104
-        $this->assertContains( 'Invalid username or e-mail', $errors["errors"]["invalidcombo"][0] );
103
+        $this->assertArrayHasKey('invalidcombo', $errors["errors"]);
104
+        $this->assertContains('Invalid username or e-mail', $errors["errors"]["invalidcombo"][0]);
105 105
     }
106 106
 
107 107
     public function tearDown()
Please login to merge, or discard this patch.
tests/test-Delete_Listing.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -1,40 +1,40 @@
 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
-        deactivate_plugins('buddypress/bp-loader.php');
9
-        remove_filter( 'muplugins_loaded', '_tests_load_bp_registration_options' );
10
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(1);
8
+		deactivate_plugins('buddypress/bp-loader.php');
9
+		remove_filter( 'muplugins_loaded', '_tests_load_bp_registration_options' );
10
+	}
11 11
 
12
-    public function testDeleteListing()
13
-    {
14
-        $query_args = array(
15
-            'post_status' => 'publish',
16
-            'post_type' => 'gd_place',
17
-            'posts_per_page' => 1,
18
-            'author' => 1
19
-        );
12
+	public function testDeleteListing()
13
+	{
14
+		$query_args = array(
15
+			'post_status' => 'publish',
16
+			'post_type' => 'gd_place',
17
+			'posts_per_page' => 1,
18
+			'author' => 1
19
+		);
20 20
 
21
-        $all_posts = new WP_Query( $query_args );
22
-        $post_id = null;
23
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
24
-            $post_id = get_the_ID();
25
-        endwhile;
21
+		$all_posts = new WP_Query( $query_args );
22
+		$post_id = null;
23
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
24
+			$post_id = get_the_ID();
25
+		endwhile;
26 26
 
27
-        $this->assertTrue(is_int($post_id));
27
+		$this->assertTrue(is_int($post_id));
28 28
 
29
-        $lastid = wp_delete_post($post_id);
29
+		$lastid = wp_delete_post($post_id);
30 30
 
31
-        $this->assertTrue(is_int($lastid->ID));
31
+		$this->assertTrue(is_int($lastid->ID));
32 32
 
33
-    }
33
+	}
34 34
 
35
-    public function tearDown()
36
-    {
37
-        parent::tearDown();
38
-    }
35
+	public function tearDown()
36
+	{
37
+		parent::tearDown();
38
+	}
39 39
 }
40 40
 ?>
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
         parent::setUp();
7 7
         wp_set_current_user(1);
8 8
         deactivate_plugins('buddypress/bp-loader.php');
9
-        remove_filter( 'muplugins_loaded', '_tests_load_bp_registration_options' );
9
+        remove_filter('muplugins_loaded', '_tests_load_bp_registration_options');
10 10
     }
11 11
 
12 12
     public function testDeleteListing()
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
             'author' => 1
19 19
         );
20 20
 
21
-        $all_posts = new WP_Query( $query_args );
21
+        $all_posts = new WP_Query($query_args);
22 22
         $post_id = null;
23
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
23
+        while ($all_posts->have_posts()) : $all_posts->the_post();
24 24
             $post_id = get_the_ID();
25 25
         endwhile;
26 26
 
Please login to merge, or discard this patch.
tests/test-Edit_Listing.php 2 patches
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -1,63 +1,63 @@
 block discarded – undo
1 1
 <?php
2 2
 class EditListing extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        wp_set_current_user(1);
8
-    }
9
-
10
-    public function testEditListing()
11
-    {
12
-        $query_args = array(
13
-            'post_status' => 'publish',
14
-            'post_type' => 'gd_place',
15
-            'posts_per_page' => 1,
16
-        );
17
-
18
-        $all_posts = new WP_Query( $query_args );
19
-        $post_id = null;
20
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
21
-            $post_id = get_the_ID();
22
-        endwhile;
23
-
24
-        $this->assertTrue(is_int($post_id));
25
-
26
-        $args = array(
27
-            'pid' => $post_id,
28
-            'listing_type' => 'gd_place',
29
-            'post_title' => 'Test Listing Title Modified',
30
-            'post_desc' => 'Test Desc',
31
-            'post_tags' => 'test1,test2',
32
-            'post_address' => 'New York City Hall',
33
-            'post_zip' => '10007',
34
-            'post_latitude' => '40.7127837',
35
-            'post_longitude' => '-74.00594130000002',
36
-            'post_mapview' => 'ROADMAP',
37
-            'post_mapzoom' => '10',
38
-            'geodir_timing' => '10.00 am to 6 pm every day',
39
-            'geodir_contact' => '1234567890',
40
-            'geodir_email' => '[email protected]',
41
-            'geodir_website' => 'http://test.com',
42
-            'geodir_twitter' => 'http://twitter.com/test',
43
-            'geodir_facebook' => 'http://facebook.com/test',
44
-            'geodir_special_offers' => 'Test offer'
45
-        );
46
-        $saved_post_id = geodir_save_listing($args, true);
47
-
48
-        $this->assertTrue(is_int($saved_post_id));
49
-
50
-        $title = get_the_title($post_id);
51
-
52
-        $this->assertEquals('Test Listing Title Modified', $title);
53
-
54
-
55
-    }
56
-
57
-
58
-    public function tearDown()
59
-    {
60
-        parent::tearDown();
61
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(1);
8
+	}
9
+
10
+	public function testEditListing()
11
+	{
12
+		$query_args = array(
13
+			'post_status' => 'publish',
14
+			'post_type' => 'gd_place',
15
+			'posts_per_page' => 1,
16
+		);
17
+
18
+		$all_posts = new WP_Query( $query_args );
19
+		$post_id = null;
20
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
21
+			$post_id = get_the_ID();
22
+		endwhile;
23
+
24
+		$this->assertTrue(is_int($post_id));
25
+
26
+		$args = array(
27
+			'pid' => $post_id,
28
+			'listing_type' => 'gd_place',
29
+			'post_title' => 'Test Listing Title Modified',
30
+			'post_desc' => 'Test Desc',
31
+			'post_tags' => 'test1,test2',
32
+			'post_address' => 'New York City Hall',
33
+			'post_zip' => '10007',
34
+			'post_latitude' => '40.7127837',
35
+			'post_longitude' => '-74.00594130000002',
36
+			'post_mapview' => 'ROADMAP',
37
+			'post_mapzoom' => '10',
38
+			'geodir_timing' => '10.00 am to 6 pm every day',
39
+			'geodir_contact' => '1234567890',
40
+			'geodir_email' => '[email protected]',
41
+			'geodir_website' => 'http://test.com',
42
+			'geodir_twitter' => 'http://twitter.com/test',
43
+			'geodir_facebook' => 'http://facebook.com/test',
44
+			'geodir_special_offers' => 'Test offer'
45
+		);
46
+		$saved_post_id = geodir_save_listing($args, true);
47
+
48
+		$this->assertTrue(is_int($saved_post_id));
49
+
50
+		$title = get_the_title($post_id);
51
+
52
+		$this->assertEquals('Test Listing Title Modified', $title);
53
+
54
+
55
+	}
56
+
57
+
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.
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-Register.php 2 patches
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -1,89 +1,89 @@
 block discarded – undo
1 1
 <?php
2 2
 class Register extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        wp_set_current_user(0);
8
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(0);
8
+	}
9 9
 
10
-    public function test_register_empty_username() {
11
-        $errors = geodir_register_new_user(
12
-            '',
13
-            '[email protected]'
14
-        );
15
-        $errors = (array) $errors;
16
-        $this->assertArrayHasKey( 'empty_username', $errors["errors"] );
17
-        $this->assertContains( 'Please enter a username', $errors["errors"]["empty_username"][0] );
18
-    }
10
+	public function test_register_empty_username() {
11
+		$errors = geodir_register_new_user(
12
+			'',
13
+			'[email protected]'
14
+		);
15
+		$errors = (array) $errors;
16
+		$this->assertArrayHasKey( 'empty_username', $errors["errors"] );
17
+		$this->assertContains( 'Please enter a username', $errors["errors"]["empty_username"][0] );
18
+	}
19 19
 
20
-    public function test_register_invalid_username() {
21
-        $errors = geodir_register_new_user(
22
-            '@#$%^',
23
-            '[email protected]'
24
-        );
25
-        $errors = (array) $errors;
26
-        $this->assertArrayHasKey( 'invalid_username', $errors["errors"] );
27
-        $this->assertContains( 'This username is invalid', $errors["errors"]["invalid_username"][0] );
28
-    }
20
+	public function test_register_invalid_username() {
21
+		$errors = geodir_register_new_user(
22
+			'@#$%^',
23
+			'[email protected]'
24
+		);
25
+		$errors = (array) $errors;
26
+		$this->assertArrayHasKey( 'invalid_username', $errors["errors"] );
27
+		$this->assertContains( 'This username is invalid', $errors["errors"]["invalid_username"][0] );
28
+	}
29 29
 
30
-    public function test_register_invalid_email() {
31
-        $errors = geodir_register_new_user(
32
-            'hello',
33
-            'hello@@hi.com'
34
-        );
35
-        $errors = (array) $errors;
36
-        $this->assertArrayHasKey( 'invalid_email', $errors["errors"] );
37
-        $this->assertContains( 'The email address isn&#8217;t correct', $errors["errors"]["invalid_email"][0] );
38
-    }
30
+	public function test_register_invalid_email() {
31
+		$errors = geodir_register_new_user(
32
+			'hello',
33
+			'hello@@hi.com'
34
+		);
35
+		$errors = (array) $errors;
36
+		$this->assertArrayHasKey( 'invalid_email', $errors["errors"] );
37
+		$this->assertContains( 'The email address isn&#8217;t correct', $errors["errors"]["invalid_email"][0] );
38
+	}
39 39
 
40
-    public function test_register_empty_email() {
41
-        $errors = geodir_register_new_user(
42
-            'hello',
43
-            ''
44
-        );
45
-        $errors = (array) $errors;
46
-        $this->assertArrayHasKey( 'empty_email', $errors["errors"] );
47
-        $this->assertContains( 'Please type your e-mail address', $errors["errors"]["empty_email"][0] );
48
-    }
40
+	public function test_register_empty_email() {
41
+		$errors = geodir_register_new_user(
42
+			'hello',
43
+			''
44
+		);
45
+		$errors = (array) $errors;
46
+		$this->assertArrayHasKey( 'empty_email', $errors["errors"] );
47
+		$this->assertContains( 'Please type your e-mail address', $errors["errors"]["empty_email"][0] );
48
+	}
49 49
 
50
-    public function test_register_invalid_password() {
51
-        update_option('geodir_allow_cpass', 1);
52
-        $_REQUEST['user_pass'] = '12345';
53
-        $_REQUEST['user_pass2'] = '1234';
54
-        $_POST['user_fname'] = 'Test User';
55
-        $errors = geodir_register_new_user(
56
-            'hello',
57
-            '[email protected]'
58
-        );
59
-        $errors = (array) $errors;
60
-        $this->assertArrayHasKey( 'pass_match', $errors["errors"] );
61
-        $this->assertContains( 'Passwords do not match', $errors["errors"]["pass_match"][0] );
50
+	public function test_register_invalid_password() {
51
+		update_option('geodir_allow_cpass', 1);
52
+		$_REQUEST['user_pass'] = '12345';
53
+		$_REQUEST['user_pass2'] = '1234';
54
+		$_POST['user_fname'] = 'Test User';
55
+		$errors = geodir_register_new_user(
56
+			'hello',
57
+			'[email protected]'
58
+		);
59
+		$errors = (array) $errors;
60
+		$this->assertArrayHasKey( 'pass_match', $errors["errors"] );
61
+		$this->assertContains( 'Passwords do not match', $errors["errors"]["pass_match"][0] );
62 62
 
63
-        $_REQUEST['user_pass'] = '12345';
64
-        $_REQUEST['user_pass2'] = '12345';
65
-        $errors = geodir_register_new_user(
66
-            'hello',
67
-            '[email protected]'
68
-        );
69
-        $errors = (array) $errors;
70
-        $this->assertArrayHasKey( 'pass_match', $errors["errors"] );
71
-        $this->assertContains( 'Password must be 7 characters or more', $errors["errors"]["pass_match"][0] );
72
-    }
63
+		$_REQUEST['user_pass'] = '12345';
64
+		$_REQUEST['user_pass2'] = '12345';
65
+		$errors = geodir_register_new_user(
66
+			'hello',
67
+			'[email protected]'
68
+		);
69
+		$errors = (array) $errors;
70
+		$this->assertArrayHasKey( 'pass_match', $errors["errors"] );
71
+		$this->assertContains( 'Password must be 7 characters or more', $errors["errors"]["pass_match"][0] );
72
+	}
73 73
 
74
-    public function test_register_success() {
75
-        $_POST['user_fname'] = 'Test User';
76
-        $data = geodir_register_new_user(
77
-            'hello',
78
-            '[email protected]'
79
-        );
80
-        $this->assertInternalType("int", $data[0]);
81
-    }
74
+	public function test_register_success() {
75
+		$_POST['user_fname'] = 'Test User';
76
+		$data = geodir_register_new_user(
77
+			'hello',
78
+			'[email protected]'
79
+		);
80
+		$this->assertInternalType("int", $data[0]);
81
+	}
82 82
 
83
-    public function tearDown()
84
-    {
85
-        parent::tearDown();
86
-    }
83
+	public function tearDown()
84
+	{
85
+		parent::tearDown();
86
+	}
87 87
 
88 88
 }
89 89
 ?>
90 90
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
             '[email protected]'
14 14
         );
15 15
         $errors = (array) $errors;
16
-        $this->assertArrayHasKey( 'empty_username', $errors["errors"] );
17
-        $this->assertContains( 'Please enter a username', $errors["errors"]["empty_username"][0] );
16
+        $this->assertArrayHasKey('empty_username', $errors["errors"]);
17
+        $this->assertContains('Please enter a username', $errors["errors"]["empty_username"][0]);
18 18
     }
19 19
 
20 20
     public function test_register_invalid_username() {
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
             '[email protected]'
24 24
         );
25 25
         $errors = (array) $errors;
26
-        $this->assertArrayHasKey( 'invalid_username', $errors["errors"] );
27
-        $this->assertContains( 'This username is invalid', $errors["errors"]["invalid_username"][0] );
26
+        $this->assertArrayHasKey('invalid_username', $errors["errors"]);
27
+        $this->assertContains('This username is invalid', $errors["errors"]["invalid_username"][0]);
28 28
     }
29 29
 
30 30
     public function test_register_invalid_email() {
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
             'hello@@hi.com'
34 34
         );
35 35
         $errors = (array) $errors;
36
-        $this->assertArrayHasKey( 'invalid_email', $errors["errors"] );
37
-        $this->assertContains( 'The email address isn&#8217;t correct', $errors["errors"]["invalid_email"][0] );
36
+        $this->assertArrayHasKey('invalid_email', $errors["errors"]);
37
+        $this->assertContains('The email address isn&#8217;t correct', $errors["errors"]["invalid_email"][0]);
38 38
     }
39 39
 
40 40
     public function test_register_empty_email() {
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
             ''
44 44
         );
45 45
         $errors = (array) $errors;
46
-        $this->assertArrayHasKey( 'empty_email', $errors["errors"] );
47
-        $this->assertContains( 'Please type your e-mail address', $errors["errors"]["empty_email"][0] );
46
+        $this->assertArrayHasKey('empty_email', $errors["errors"]);
47
+        $this->assertContains('Please type your e-mail address', $errors["errors"]["empty_email"][0]);
48 48
     }
49 49
 
50 50
     public function test_register_invalid_password() {
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
             '[email protected]'
58 58
         );
59 59
         $errors = (array) $errors;
60
-        $this->assertArrayHasKey( 'pass_match', $errors["errors"] );
61
-        $this->assertContains( 'Passwords do not match', $errors["errors"]["pass_match"][0] );
60
+        $this->assertArrayHasKey('pass_match', $errors["errors"]);
61
+        $this->assertContains('Passwords do not match', $errors["errors"]["pass_match"][0]);
62 62
 
63 63
         $_REQUEST['user_pass'] = '12345';
64 64
         $_REQUEST['user_pass2'] = '12345';
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
             '[email protected]'
68 68
         );
69 69
         $errors = (array) $errors;
70
-        $this->assertArrayHasKey( 'pass_match', $errors["errors"] );
71
-        $this->assertContains( 'Password must be 7 characters or more', $errors["errors"]["pass_match"][0] );
70
+        $this->assertArrayHasKey('pass_match', $errors["errors"]);
71
+        $this->assertContains('Password must be 7 characters or more', $errors["errors"]["pass_match"][0]);
72 72
     }
73 73
 
74 74
     public function test_register_success() {
Please login to merge, or discard this patch.
tests/test-Add_Custom_Fields.php 2 patches
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -1,76 +1,76 @@
 block discarded – undo
1 1
 <?php
2 2
 class AddCustomFields 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 testAddCustomFields()
10
-    {
11
-        $field = array(
12
-            'listing_type'  => 'gd_place',
13
-            'data_type'     => '',
14
-            'field_type'    => 'select',
15
-            'admin_title'   => __( 'Place Type', 'test' ),
16
-            'admin_desc'    => __( 'Select the place type.', 'test' ),
17
-            'site_title'    => __( 'Place Type', 'test' ),
18
-            'htmlvar_name'  => 'test_place_type',
19
-            'default_value' => '',
20
-            'option_values' => 'Hotel,Bar,Restaurant,Pub',
21
-            'is_default'    => '1',
22
-            'is_admin'      => '1',
23
-            'clabels'       => __( 'Place Type', 'test' )
24
-        );
9
+	public function testAddCustomFields()
10
+	{
11
+		$field = array(
12
+			'listing_type'  => 'gd_place',
13
+			'data_type'     => '',
14
+			'field_type'    => 'select',
15
+			'admin_title'   => __( 'Place Type', 'test' ),
16
+			'admin_desc'    => __( 'Select the place type.', 'test' ),
17
+			'site_title'    => __( 'Place Type', 'test' ),
18
+			'htmlvar_name'  => 'test_place_type',
19
+			'default_value' => '',
20
+			'option_values' => 'Hotel,Bar,Restaurant,Pub',
21
+			'is_default'    => '1',
22
+			'is_admin'      => '1',
23
+			'clabels'       => __( 'Place Type', 'test' )
24
+		);
25 25
 
26
-        $lastid = geodir_custom_field_save( $field );
26
+		$lastid = geodir_custom_field_save( $field );
27 27
 
28
-        $this->assertTrue(is_int($lastid));
28
+		$this->assertTrue(is_int($lastid));
29 29
 
30 30
 
31
-        $field2 = array(
32
-            'listing_type'  => 'gd_place',
33
-            'data_type'     => 'VARCHAR',
34
-            'field_type'    => 'url',
35
-            'admin_title'   => __( 'Website Link', 'test' ),
36
-            'admin_desc'    => __( 'Enter the website link.', 'test' ),
37
-            'site_title'    => __( 'Website Link', 'test' ),
38
-            'htmlvar_name'  => 'test_ws_link',
39
-            'default_value' => '',
40
-            'option_values' => '',
41
-            'is_default'    => '1',
42
-            'is_admin'      => '1',
43
-            'clabels'       => __( 'Website Link', 'test' )
44
-        );
31
+		$field2 = array(
32
+			'listing_type'  => 'gd_place',
33
+			'data_type'     => 'VARCHAR',
34
+			'field_type'    => 'url',
35
+			'admin_title'   => __( 'Website Link', 'test' ),
36
+			'admin_desc'    => __( 'Enter the website link.', 'test' ),
37
+			'site_title'    => __( 'Website Link', 'test' ),
38
+			'htmlvar_name'  => 'test_ws_link',
39
+			'default_value' => '',
40
+			'option_values' => '',
41
+			'is_default'    => '1',
42
+			'is_admin'      => '1',
43
+			'clabels'       => __( 'Website Link', 'test' )
44
+		);
45 45
 
46
-        $lastid2 = geodir_custom_field_save( $field2 );
46
+		$lastid2 = geodir_custom_field_save( $field2 );
47 47
 
48
-        $this->assertTrue(is_int($lastid2));
48
+		$this->assertTrue(is_int($lastid2));
49 49
 
50
-        //test error
51
-        $field3 = array(
52
-            'listing_type'  => 'gd_place',
53
-            'data_type'     => '',
54
-            'field_type'    => 'select',
55
-            'admin_title'   => __( 'Place Type', 'test' ),
56
-            'admin_desc'    => __( 'Select the place type.', 'test' ),
57
-            'site_title'    => __( 'Place Type', 'test' ),
58
-            'htmlvar_name'  => 'test_place_type',
59
-            'default_value' => '',
60
-            'option_values' => 'Hotel,Bar,Restaurant,Pub',
61
-            'is_default'    => '1',
62
-            'is_admin'      => '1',
63
-            'clabels'       => __( 'Place Type', 'test' )
64
-        );
50
+		//test error
51
+		$field3 = array(
52
+			'listing_type'  => 'gd_place',
53
+			'data_type'     => '',
54
+			'field_type'    => 'select',
55
+			'admin_title'   => __( 'Place Type', 'test' ),
56
+			'admin_desc'    => __( 'Select the place type.', 'test' ),
57
+			'site_title'    => __( 'Place Type', 'test' ),
58
+			'htmlvar_name'  => 'test_place_type',
59
+			'default_value' => '',
60
+			'option_values' => 'Hotel,Bar,Restaurant,Pub',
61
+			'is_default'    => '1',
62
+			'is_admin'      => '1',
63
+			'clabels'       => __( 'Place Type', 'test' )
64
+		);
65 65
 
66
-        $error = geodir_custom_field_save( $field3 );
66
+		$error = geodir_custom_field_save( $field3 );
67 67
 
68
-        $this->assertContains( 'HTML Variable Name should be a unique name', $error );
69
-    }
68
+		$this->assertContains( 'HTML Variable Name should be a unique name', $error );
69
+	}
70 70
 
71
-    public function tearDown()
72
-    {
73
-        parent::tearDown();
74
-    }
71
+	public function tearDown()
72
+	{
73
+		parent::tearDown();
74
+	}
75 75
 }
76 76
 ?>
77 77
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -12,18 +12,18 @@  discard block
 block discarded – undo
12 12
             'listing_type'  => 'gd_place',
13 13
             'data_type'     => '',
14 14
             'field_type'    => 'select',
15
-            'admin_title'   => __( 'Place Type', 'test' ),
16
-            'admin_desc'    => __( 'Select the place type.', 'test' ),
17
-            'site_title'    => __( 'Place Type', 'test' ),
15
+            'admin_title'   => __('Place Type', 'test'),
16
+            'admin_desc'    => __('Select the place type.', 'test'),
17
+            'site_title'    => __('Place Type', 'test'),
18 18
             'htmlvar_name'  => 'test_place_type',
19 19
             'default_value' => '',
20 20
             'option_values' => 'Hotel,Bar,Restaurant,Pub',
21 21
             'is_default'    => '1',
22 22
             'is_admin'      => '1',
23
-            'clabels'       => __( 'Place Type', 'test' )
23
+            'clabels'       => __('Place Type', 'test')
24 24
         );
25 25
 
26
-        $lastid = geodir_custom_field_save( $field );
26
+        $lastid = geodir_custom_field_save($field);
27 27
 
28 28
         $this->assertTrue(is_int($lastid));
29 29
 
@@ -32,18 +32,18 @@  discard block
 block discarded – undo
32 32
             'listing_type'  => 'gd_place',
33 33
             'data_type'     => 'VARCHAR',
34 34
             'field_type'    => 'url',
35
-            'admin_title'   => __( 'Website Link', 'test' ),
36
-            'admin_desc'    => __( 'Enter the website link.', 'test' ),
37
-            'site_title'    => __( 'Website Link', 'test' ),
35
+            'admin_title'   => __('Website Link', 'test'),
36
+            'admin_desc'    => __('Enter the website link.', 'test'),
37
+            'site_title'    => __('Website Link', 'test'),
38 38
             'htmlvar_name'  => 'test_ws_link',
39 39
             'default_value' => '',
40 40
             'option_values' => '',
41 41
             'is_default'    => '1',
42 42
             'is_admin'      => '1',
43
-            'clabels'       => __( 'Website Link', 'test' )
43
+            'clabels'       => __('Website Link', 'test')
44 44
         );
45 45
 
46
-        $lastid2 = geodir_custom_field_save( $field2 );
46
+        $lastid2 = geodir_custom_field_save($field2);
47 47
 
48 48
         $this->assertTrue(is_int($lastid2));
49 49
 
@@ -52,20 +52,20 @@  discard block
 block discarded – undo
52 52
             'listing_type'  => 'gd_place',
53 53
             'data_type'     => '',
54 54
             'field_type'    => 'select',
55
-            'admin_title'   => __( 'Place Type', 'test' ),
56
-            'admin_desc'    => __( 'Select the place type.', 'test' ),
57
-            'site_title'    => __( 'Place Type', 'test' ),
55
+            'admin_title'   => __('Place Type', 'test'),
56
+            'admin_desc'    => __('Select the place type.', 'test'),
57
+            'site_title'    => __('Place Type', 'test'),
58 58
             'htmlvar_name'  => 'test_place_type',
59 59
             'default_value' => '',
60 60
             'option_values' => 'Hotel,Bar,Restaurant,Pub',
61 61
             'is_default'    => '1',
62 62
             'is_admin'      => '1',
63
-            'clabels'       => __( 'Place Type', 'test' )
63
+            'clabels'       => __('Place Type', 'test')
64 64
         );
65 65
 
66
-        $error = geodir_custom_field_save( $field3 );
66
+        $error = geodir_custom_field_save($field3);
67 67
 
68
-        $this->assertContains( 'HTML Variable Name should be a unique name', $error );
68
+        $this->assertContains('HTML Variable Name should be a unique name', $error);
69 69
     }
70 70
 
71 71
     public function tearDown()
Please login to merge, or discard this patch.
tests/test-Check_Notifications.php 2 patches
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -1,92 +1,92 @@
 block discarded – undo
1 1
 <?php
2 2
 class CheckNotifications 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 testSendFriendEmail()
10
-    {
11
-        add_filter('wp_mail', 'print_mail');
12
-        ob_start();
13
-        geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_friend');
14
-        $output = ob_get_clean();
15
-        remove_filter('wp_mail', 'print_mail');
16
-        $this->assertContains( 'thought you might be interested in', $output );
17
-        $this->assertContains( 'Your friend has sent you a message from', $output );
18
-        $this->assertContains( '[email protected]', $output );
19
-        $this->assertContains( 'ADMIN BCC COPY', $output );
20
-    }
9
+	public function testSendFriendEmail()
10
+	{
11
+		add_filter('wp_mail', 'print_mail');
12
+		ob_start();
13
+		geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_friend');
14
+		$output = ob_get_clean();
15
+		remove_filter('wp_mail', 'print_mail');
16
+		$this->assertContains( 'thought you might be interested in', $output );
17
+		$this->assertContains( 'Your friend has sent you a message from', $output );
18
+		$this->assertContains( '[email protected]', $output );
19
+		$this->assertContains( 'ADMIN BCC COPY', $output );
20
+	}
21 21
 
22
-    public function testSendEnquiryEmail()
23
-    {
24
-        add_filter('wp_mail', 'print_mail');
25
-        ob_start();
26
-        geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_enquiry');
27
-        $output = ob_get_clean();
28
-        remove_filter('wp_mail', 'print_mail');
29
-        $this->assertContains( 'Website Enquiry', $output );
30
-        $this->assertContains( 'An enquiry has been sent from', $output );
31
-        $this->assertContains( '[email protected]', $output );
32
-        $this->assertContains( 'ADMIN BCC COPY', $output );
33
-    }
22
+	public function testSendEnquiryEmail()
23
+	{
24
+		add_filter('wp_mail', 'print_mail');
25
+		ob_start();
26
+		geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_enquiry');
27
+		$output = ob_get_clean();
28
+		remove_filter('wp_mail', 'print_mail');
29
+		$this->assertContains( 'Website Enquiry', $output );
30
+		$this->assertContains( 'An enquiry has been sent from', $output );
31
+		$this->assertContains( '[email protected]', $output );
32
+		$this->assertContains( 'ADMIN BCC COPY', $output );
33
+	}
34 34
 
35
-    public function testForgotPassEmail()
36
-    {
37
-        add_filter('wp_mail', 'print_mail');
38
-        ob_start();
39
-        geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'forgot_password');
40
-        $output = ob_get_clean();
41
-        remove_filter('wp_mail', 'print_mail');
42
-        $this->assertContains( 'Your new password', $output );
43
-        $this->assertContains( 'You requested a new password for', $output );
44
-        $this->assertContains( '[email protected]', $output );
45
-    }
35
+	public function testForgotPassEmail()
36
+	{
37
+		add_filter('wp_mail', 'print_mail');
38
+		ob_start();
39
+		geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'forgot_password');
40
+		$output = ob_get_clean();
41
+		remove_filter('wp_mail', 'print_mail');
42
+		$this->assertContains( 'Your new password', $output );
43
+		$this->assertContains( 'You requested a new password for', $output );
44
+		$this->assertContains( '[email protected]', $output );
45
+	}
46 46
 
47
-    public function testRegistrationEmail()
48
-    {
49
-        add_filter('wp_mail', 'print_mail');
50
-        ob_start();
51
-        geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'registration');
52
-        $output = ob_get_clean();
53
-        remove_filter('wp_mail', 'print_mail');
54
-        $this->assertContains( 'Your Log In Details', $output );
55
-        $this->assertContains( 'You can log in  with the following information', $output );
56
-        $this->assertContains( '[email protected]', $output );
57
-        $this->assertContains( 'ADMIN BCC COPY', $output );
58
-    }
47
+	public function testRegistrationEmail()
48
+	{
49
+		add_filter('wp_mail', 'print_mail');
50
+		ob_start();
51
+		geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'registration');
52
+		$output = ob_get_clean();
53
+		remove_filter('wp_mail', 'print_mail');
54
+		$this->assertContains( 'Your Log In Details', $output );
55
+		$this->assertContains( 'You can log in  with the following information', $output );
56
+		$this->assertContains( '[email protected]', $output );
57
+		$this->assertContains( 'ADMIN BCC COPY', $output );
58
+	}
59 59
 
60
-    public function testPostSubmitEmail()
61
-    {
62
-        add_filter('wp_mail', 'print_mail');
63
-        ob_start();
64
-        geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'post_submit');
65
-        $output = ob_get_clean();
66
-        remove_filter('wp_mail', 'print_mail');
67
-        $this->assertContains( 'Post Submitted Successfully', $output );
68
-        $this->assertContains( 'You submitted the below listing information', $output );
69
-        $this->assertContains( '[email protected]', $output );
70
-        $this->assertContains( 'ADMIN BCC COPY', $output );
71
-        $this->assertContains( 'A new  listing has been published', $output );
72
-    }
60
+	public function testPostSubmitEmail()
61
+	{
62
+		add_filter('wp_mail', 'print_mail');
63
+		ob_start();
64
+		geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'post_submit');
65
+		$output = ob_get_clean();
66
+		remove_filter('wp_mail', 'print_mail');
67
+		$this->assertContains( 'Post Submitted Successfully', $output );
68
+		$this->assertContains( 'You submitted the below listing information', $output );
69
+		$this->assertContains( '[email protected]', $output );
70
+		$this->assertContains( 'ADMIN BCC COPY', $output );
71
+		$this->assertContains( 'A new  listing has been published', $output );
72
+	}
73 73
 
74
-    public function testListingPublishedEmail()
75
-    {
76
-        add_filter('wp_mail', 'print_mail');
77
-        ob_start();
78
-        geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'listing_published');
79
-        $output = ob_get_clean();
80
-        remove_filter('wp_mail', 'print_mail');
81
-        $this->assertContains( 'Listing Published Successfully', $output );
82
-        $this->assertContains( 'Your listing  has been published', $output );
83
-        $this->assertContains( '[email protected]', $output );
84
-        $this->assertContains( 'ADMIN BCC COPY', $output );
85
-    }
74
+	public function testListingPublishedEmail()
75
+	{
76
+		add_filter('wp_mail', 'print_mail');
77
+		ob_start();
78
+		geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'listing_published');
79
+		$output = ob_get_clean();
80
+		remove_filter('wp_mail', 'print_mail');
81
+		$this->assertContains( 'Listing Published Successfully', $output );
82
+		$this->assertContains( 'Your listing  has been published', $output );
83
+		$this->assertContains( '[email protected]', $output );
84
+		$this->assertContains( 'ADMIN BCC COPY', $output );
85
+	}
86 86
 
87
-    public function tearDown()
88
-    {
89
-        parent::tearDown();
90
-    }
87
+	public function tearDown()
88
+	{
89
+		parent::tearDown();
90
+	}
91 91
 }
92 92
 ?>
93 93
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -10,78 +10,78 @@
 block discarded – undo
10 10
     {
11 11
         add_filter('wp_mail', 'print_mail');
12 12
         ob_start();
13
-        geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_friend');
13
+        geodir_sendEmail('', '', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_friend');
14 14
         $output = ob_get_clean();
15 15
         remove_filter('wp_mail', 'print_mail');
16
-        $this->assertContains( 'thought you might be interested in', $output );
17
-        $this->assertContains( 'Your friend has sent you a message from', $output );
18
-        $this->assertContains( '[email protected]', $output );
19
-        $this->assertContains( 'ADMIN BCC COPY', $output );
16
+        $this->assertContains('thought you might be interested in', $output);
17
+        $this->assertContains('Your friend has sent you a message from', $output);
18
+        $this->assertContains('[email protected]', $output);
19
+        $this->assertContains('ADMIN BCC COPY', $output);
20 20
     }
21 21
 
22 22
     public function testSendEnquiryEmail()
23 23
     {
24 24
         add_filter('wp_mail', 'print_mail');
25 25
         ob_start();
26
-        geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_enquiry');
26
+        geodir_sendEmail('', '', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_enquiry');
27 27
         $output = ob_get_clean();
28 28
         remove_filter('wp_mail', 'print_mail');
29
-        $this->assertContains( 'Website Enquiry', $output );
30
-        $this->assertContains( 'An enquiry has been sent from', $output );
31
-        $this->assertContains( '[email protected]', $output );
32
-        $this->assertContains( 'ADMIN BCC COPY', $output );
29
+        $this->assertContains('Website Enquiry', $output);
30
+        $this->assertContains('An enquiry has been sent from', $output);
31
+        $this->assertContains('[email protected]', $output);
32
+        $this->assertContains('ADMIN BCC COPY', $output);
33 33
     }
34 34
 
35 35
     public function testForgotPassEmail()
36 36
     {
37 37
         add_filter('wp_mail', 'print_mail');
38 38
         ob_start();
39
-        geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'forgot_password');
39
+        geodir_sendEmail('', '', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'forgot_password');
40 40
         $output = ob_get_clean();
41 41
         remove_filter('wp_mail', 'print_mail');
42
-        $this->assertContains( 'Your new password', $output );
43
-        $this->assertContains( 'You requested a new password for', $output );
44
-        $this->assertContains( '[email protected]', $output );
42
+        $this->assertContains('Your new password', $output);
43
+        $this->assertContains('You requested a new password for', $output);
44
+        $this->assertContains('[email protected]', $output);
45 45
     }
46 46
 
47 47
     public function testRegistrationEmail()
48 48
     {
49 49
         add_filter('wp_mail', 'print_mail');
50 50
         ob_start();
51
-        geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'registration');
51
+        geodir_sendEmail('', '', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'registration');
52 52
         $output = ob_get_clean();
53 53
         remove_filter('wp_mail', 'print_mail');
54
-        $this->assertContains( 'Your Log In Details', $output );
55
-        $this->assertContains( 'You can log in  with the following information', $output );
56
-        $this->assertContains( '[email protected]', $output );
57
-        $this->assertContains( 'ADMIN BCC COPY', $output );
54
+        $this->assertContains('Your Log In Details', $output);
55
+        $this->assertContains('You can log in  with the following information', $output);
56
+        $this->assertContains('[email protected]', $output);
57
+        $this->assertContains('ADMIN BCC COPY', $output);
58 58
     }
59 59
 
60 60
     public function testPostSubmitEmail()
61 61
     {
62 62
         add_filter('wp_mail', 'print_mail');
63 63
         ob_start();
64
-        geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'post_submit');
64
+        geodir_sendEmail('', '', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'post_submit');
65 65
         $output = ob_get_clean();
66 66
         remove_filter('wp_mail', 'print_mail');
67
-        $this->assertContains( 'Post Submitted Successfully', $output );
68
-        $this->assertContains( 'You submitted the below listing information', $output );
69
-        $this->assertContains( '[email protected]', $output );
70
-        $this->assertContains( 'ADMIN BCC COPY', $output );
71
-        $this->assertContains( 'A new  listing has been published', $output );
67
+        $this->assertContains('Post Submitted Successfully', $output);
68
+        $this->assertContains('You submitted the below listing information', $output);
69
+        $this->assertContains('[email protected]', $output);
70
+        $this->assertContains('ADMIN BCC COPY', $output);
71
+        $this->assertContains('A new  listing has been published', $output);
72 72
     }
73 73
 
74 74
     public function testListingPublishedEmail()
75 75
     {
76 76
         add_filter('wp_mail', 'print_mail');
77 77
         ob_start();
78
-        geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'listing_published');
78
+        geodir_sendEmail('', '', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'listing_published');
79 79
         $output = ob_get_clean();
80 80
         remove_filter('wp_mail', 'print_mail');
81
-        $this->assertContains( 'Listing Published Successfully', $output );
82
-        $this->assertContains( 'Your listing  has been published', $output );
83
-        $this->assertContains( '[email protected]', $output );
84
-        $this->assertContains( 'ADMIN BCC COPY', $output );
81
+        $this->assertContains('Listing Published Successfully', $output);
82
+        $this->assertContains('Your listing  has been published', $output);
83
+        $this->assertContains('[email protected]', $output);
84
+        $this->assertContains('ADMIN BCC COPY', $output);
85 85
     }
86 86
 
87 87
     public function tearDown()
Please login to merge, or discard this patch.
tests/test-Test_Dummy_Data.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -1,50 +1,50 @@
 block discarded – undo
1 1
 <?php
2 2
 class TestDummyData extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        wp_set_current_user(1);
8
-        geodir_delete_dummy_posts();
9
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(1);
8
+		geodir_delete_dummy_posts();
9
+	}
10 10
 
11
-    public function testCreatePlaces()
12
-    {
13
-        global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
11
+	public function testCreatePlaces()
12
+	{
13
+		global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
14 14
 
15
-        global $geodir_post_custom_fields_cache;
16
-        $geodir_post_custom_fields_cache = array();
15
+		global $geodir_post_custom_fields_cache;
16
+		$geodir_post_custom_fields_cache = array();
17 17
 
18
-        $city_bound_lat1 = 40.4960439;
19
-        $city_bound_lng1 = -74.2557349;
20
-        $city_bound_lat2 = 40.91525559999999;
21
-        $city_bound_lng2 = -73.7002721;
18
+		$city_bound_lat1 = 40.4960439;
19
+		$city_bound_lng1 = -74.2557349;
20
+		$city_bound_lat2 = 40.91525559999999;
21
+		$city_bound_lng2 = -73.7002721;
22 22
 
23 23
 
24
-        $dummy_post_index = 10;
25
-        test_create_dummy_posts(10);
24
+		$dummy_post_index = 10;
25
+		test_create_dummy_posts(10);
26 26
 
27
-        $query_args = array(
28
-            'post_status' => 'publish',
29
-            'post_type' => 'gd_place'
30
-        );
27
+		$query_args = array(
28
+			'post_status' => 'publish',
29
+			'post_type' => 'gd_place'
30
+		);
31 31
 
32
-        $all_posts = new WP_Query( $query_args );
32
+		$all_posts = new WP_Query( $query_args );
33 33
 
34
-        $total_posts = $all_posts->found_posts;
34
+		$total_posts = $all_posts->found_posts;
35 35
 
36
-        $this->assertTrue((int) $total_posts > 0);
36
+		$this->assertTrue((int) $total_posts > 0);
37 37
 
38
-    }
38
+	}
39 39
 
40
-    public function testDeletePlaces()
41
-    {
42
-        geodir_delete_dummy_posts();
43
-    }
40
+	public function testDeletePlaces()
41
+	{
42
+		geodir_delete_dummy_posts();
43
+	}
44 44
 
45
-    public function tearDown()
46
-    {
47
-        parent::tearDown();
48
-    }
45
+	public function tearDown()
46
+	{
47
+		parent::tearDown();
48
+	}
49 49
 }
50 50
 ?>
51 51
\ 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
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
             'post_type' => 'gd_place'
30 30
         );
31 31
 
32
-        $all_posts = new WP_Query( $query_args );
32
+        $all_posts = new WP_Query($query_args);
33 33
 
34 34
         $total_posts = $all_posts->found_posts;
35 35
 
Please login to merge, or discard this patch.
tests/test-Import_Export.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 ImportExport 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 testImportExport()
10
-    {
9
+	public function testImportExport()
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.