Test Failed
Pull Request — master (#341)
by Kiran
32:58
created
tests/selenium/stest-29_New_Location.php 2 patches
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -1,59 +1,59 @@
 block discarded – undo
1 1
 <?php
2 2
 class NewLocation extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7 7
 
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16 16
 
17
-    public function testNewLocation()
18
-    {
19
-        $this->logInfo('Testing new location......');
20
-        //make sure multi locations plugin active
21
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
22
-        $this->waitForPageLoadAndCheckForErrors();
17
+	public function testNewLocation()
18
+	{
19
+		$this->logInfo('Testing new location......');
20
+		//make sure multi locations plugin active
21
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
22
+		$this->waitForPageLoadAndCheckForErrors();
23 23
 
24
-        $is_active = $this->byId("geodirectory-location-manager")->attribute('class');
25
-        if (is_int(strpos($is_active, 'inactive'))) {
26
-            //Activate Geodirectory Location Manager
27
-            $this->maybeActivatePlugin("geodirectory-location-manager", 20000);
28
-            //go back to plugin page
29
-            $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
30
-        }
24
+		$is_active = $this->byId("geodirectory-location-manager")->attribute('class');
25
+		if (is_int(strpos($is_active, 'inactive'))) {
26
+			//Activate Geodirectory Location Manager
27
+			$this->maybeActivatePlugin("geodirectory-location-manager", 20000);
28
+			//go back to plugin page
29
+			$this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
30
+		}
31 31
 
32
-        $is_active1 = $this->byId("geodirectory-location-manager")->attribute('class');
33
-        $this->assertFalse( strpos($is_active1, 'inactive'), "Location Manager plugin not active");
32
+		$is_active1 = $this->byId("geodirectory-location-manager")->attribute('class');
33
+		$this->assertFalse( strpos($is_active1, 'inactive'), "Location Manager plugin not active");
34 34
 
35
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=managelocation_fields&subtab=geodir_location_addedit');
36
-        $this->waitForPageLoadAndCheckForErrors();
37
-        $this->prepareSession()->currentWindow()->maximize();
38
-        $this->byId('gd_city')->value('Bengaluru');
39
-        $this->byId('gd_region')->value('Karnataka');
40
-        $this->waitForPageLoadAndCheckForErrors();
35
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=managelocation_fields&subtab=geodir_location_addedit');
36
+		$this->waitForPageLoadAndCheckForErrors();
37
+		$this->prepareSession()->currentWindow()->maximize();
38
+		$this->byId('gd_city')->value('Bengaluru');
39
+		$this->byId('gd_region')->value('Karnataka');
40
+		$this->waitForPageLoadAndCheckForErrors();
41 41
 //        $this->byId('gd_city')->value('texas');
42
-        $this->byId('gd_set_address_button')->click();
43
-        $this->waitForPageLoadAndCheckForErrors();
44
-        $this->byId('geodir_location_save')->click();
45
-        $this->waitForPageLoadAndCheckForErrors();
46
-        $this->assertTrue( $this->isTextPresent("Location saved successfully."), "'Location saved successfully' text not found");
47
-    }
42
+		$this->byId('gd_set_address_button')->click();
43
+		$this->waitForPageLoadAndCheckForErrors();
44
+		$this->byId('geodir_location_save')->click();
45
+		$this->waitForPageLoadAndCheckForErrors();
46
+		$this->assertTrue( $this->isTextPresent("Location saved successfully."), "'Location saved successfully' text not found");
47
+	}
48 48
 
49
-    public function tearDown()
50
-    {
51
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
52
-            //write current file number to completed.txt
53
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
54
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
55
-            fwrite($completed, $CurrentFileNumber);
56
-        }
57
-    }
49
+	public function tearDown()
50
+	{
51
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
52
+			//write current file number to completed.txt
53
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
54
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
55
+			fwrite($completed, $CurrentFileNumber);
56
+		}
57
+	}
58 58
 }
59 59
 ?>
60 60
\ 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
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         }
31 31
 
32 32
         $is_active1 = $this->byId("geodirectory-location-manager")->attribute('class');
33
-        $this->assertFalse( strpos($is_active1, 'inactive'), "Location Manager plugin not active");
33
+        $this->assertFalse(strpos($is_active1, 'inactive'), "Location Manager plugin not active");
34 34
 
35 35
         $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=managelocation_fields&subtab=geodir_location_addedit');
36 36
         $this->waitForPageLoadAndCheckForErrors();
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $this->waitForPageLoadAndCheckForErrors();
44 44
         $this->byId('geodir_location_save')->click();
45 45
         $this->waitForPageLoadAndCheckForErrors();
46
-        $this->assertTrue( $this->isTextPresent("Location saved successfully."), "'Location saved successfully' text not found");
46
+        $this->assertTrue($this->isTextPresent("Location saved successfully."), "'Location saved successfully' text not found");
47 47
     }
48 48
 
49 49
     public function tearDown()
Please login to merge, or discard this patch.
tests/selenium/stest-14_Delete_Listing.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,37 +1,37 @@
 block discarded – undo
1 1
 <?php
2 2
 class DeleteListing extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7 7
 
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16 16
 
17
-    public function testDeleteListing()
18
-    {
19
-        $this->logInfo('Delete Listing......');
20
-        $this->maybeUserLogin(self::GDTEST_BASE_URL.'author/test-user/?geodir_dashbord=true&stype=gd_place', true);
21
-        $this->waitForPageLoadAndCheckForErrors();
22
-        $this->byClassName('geodir-delete')->click();
23
-        $this->acceptAlert();
24
-        $this->waitForPageLoadAndCheckForErrors();
25
-    }
17
+	public function testDeleteListing()
18
+	{
19
+		$this->logInfo('Delete Listing......');
20
+		$this->maybeUserLogin(self::GDTEST_BASE_URL.'author/test-user/?geodir_dashbord=true&stype=gd_place', true);
21
+		$this->waitForPageLoadAndCheckForErrors();
22
+		$this->byClassName('geodir-delete')->click();
23
+		$this->acceptAlert();
24
+		$this->waitForPageLoadAndCheckForErrors();
25
+	}
26 26
 
27
-    public function tearDown()
28
-    {
29
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
30
-            //write current file number to completed.txt
31
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
32
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
33
-            fwrite($completed, $CurrentFileNumber);
34
-        }
35
-    }
27
+	public function tearDown()
28
+	{
29
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
30
+			//write current file number to completed.txt
31
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
32
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
33
+			fwrite($completed, $CurrentFileNumber);
34
+		}
35
+	}
36 36
 }
37 37
 ?>
38 38
\ No newline at end of file
Please login to merge, or discard this patch.
tests/selenium/stest-00_Initilaize.php 2 patches
Indentation   +236 added lines, -236 removed lines patch added patch discarded remove patch
@@ -1,67 +1,67 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 class Initialize extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-        } else {
12
-            $this->prepareSession()->currentWindow()->maximize();
13
-        }
14
-
15
-    }
16
-
17
-    public function testInitialize()
18
-    {
19
-        // Check plugins available
20
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+		} else {
12
+			$this->prepareSession()->currentWindow()->maximize();
13
+		}
14
+
15
+	}
16
+
17
+	public function testInitialize()
18
+	{
19
+		// Check plugins available
20
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
21 21
 //        echo $this->source();
22
-        $this->waitForPageLoadAndCheckForErrors();
23
-
24
-        $stop_script = false;
25
-
26
-        $plugins = array(
27
-            'geodirectory',
28
-            'geodirectory-advance-search-filters',
29
-            'geodirectory-affiliatewp-integration',
30
-            'geodirectory-ajax-duplicate-alert',
31
-            'geodirectory-buddypress-integration',
32
-            'geodirectory-claim-manager',
33
-            'geodirectory-custom-post-types',
34
-            'geodirectory-events',
35
-            'gd-booster',
36
-            'geodirectory-location-manager',
37
-            'geodirectory-marker-cluster',
38
-            'geodirectory-payment-manager',
39
-            'geodirectory-re-captcha',
40
-            'geodirectory-review-rating-manager',
41
-            'geodirectory-social-importer',
42
-            'stripe-payment-geodirectory-add-on',
43
-            'buddypress',
22
+		$this->waitForPageLoadAndCheckForErrors();
23
+
24
+		$stop_script = false;
25
+
26
+		$plugins = array(
27
+			'geodirectory',
28
+			'geodirectory-advance-search-filters',
29
+			'geodirectory-affiliatewp-integration',
30
+			'geodirectory-ajax-duplicate-alert',
31
+			'geodirectory-buddypress-integration',
32
+			'geodirectory-claim-manager',
33
+			'geodirectory-custom-post-types',
34
+			'geodirectory-events',
35
+			'gd-booster',
36
+			'geodirectory-location-manager',
37
+			'geodirectory-marker-cluster',
38
+			'geodirectory-payment-manager',
39
+			'geodirectory-re-captcha',
40
+			'geodirectory-review-rating-manager',
41
+			'geodirectory-social-importer',
42
+			'stripe-payment-geodirectory-add-on',
43
+			'buddypress',
44 44
 //            'wordpress-database-reset'
45
-        );
45
+		);
46 46
 
47
-        foreach ($plugins as $plugin) {
48
-            if (!$this->isElementExists($plugin)) {
49
-                $plugin_name = ucwords(str_replace('-', ' ', $plugin));
50
-                $this->logError($plugin_name.' not installed');
51
-                $stop_script = true;
52
-            }
53
-        }
47
+		foreach ($plugins as $plugin) {
48
+			if (!$this->isElementExists($plugin)) {
49
+				$plugin_name = ucwords(str_replace('-', ' ', $plugin));
50
+				$this->logError($plugin_name.' not installed');
51
+				$stop_script = true;
52
+			}
53
+		}
54 54
 
55
-        if($stop_script) {
56
-            $this->logError("Stopping the script. Please fix the errors to continue");
57
-            return;
58
-        }
55
+		if($stop_script) {
56
+			$this->logError("Stopping the script. Please fix the errors to continue");
57
+			return;
58
+		}
59 59
 
60 60
 
61
-        //Activate WordPress database reset
62
-        //$this->maybeActivatePlugin("wordpress-database-reset");
61
+		//Activate WordPress database reset
62
+		//$this->maybeActivatePlugin("wordpress-database-reset");
63 63
 
64
-        //reset the db
64
+		//reset the db
65 65
 //        $this->logInfo('Resetting WordPress database......');
66 66
 //        $this->url(self::GDTEST_BASE_URL.'wp-admin/tools.php?page=database-reset');
67 67
 //        $this->waitForPageLoadAndCheckForErrors();
@@ -75,194 +75,194 @@  discard block
 block discarded – undo
75 75
 //        $this->acceptAlert();
76 76
 //        $this->waitForPageLoadAndCheckForErrors();
77 77
 
78
-        // make sure all plugins not active. We will activate it programatically.
79
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
80
-        $this->waitForPageLoadAndCheckForErrors();
81
-        $this->hideAdminBar();
78
+		// make sure all plugins not active. We will activate it programatically.
79
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
80
+		$this->waitForPageLoadAndCheckForErrors();
81
+		$this->hideAdminBar();
82 82
 
83 83
 //        if(($key = array_search('wordpress-database-reset', $plugins)) !== false) {
84 84
 //            unset($plugins[$key]);
85 85
 //        }
86 86
 
87
-        foreach ($plugins as $plugin) {
88
-            if (!is_int(strpos($this->byId($plugin)->attribute('class'), 'inactive'))) {
89
-                $plugin_name = ucwords(str_replace('-', ' ', $plugin));
90
-                $this->logError($plugin_name." is active. Please deactivate it. It will be activated programatically.");
91
-                $stop_script = true;
92
-            }
93
-        }
94
-
95
-
96
-        if($stop_script) {
97
-            $this->logInfo("Stopping the script. Please fix the errors to continue");
98
-            return;
99
-        }
100
-
101
-        //make sure GDF theme installed
102
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/themes.php');
103
-        $this->waitForPageLoadAndCheckForErrors();
104
-        if (!$this->isElementExists("GeoDirectory_framework-name")) {
105
-            $this->logError("GeoDirectory Framework theme not installed");
106
-            $stop_script = true;
107
-        }
108
-
109
-        if (!$this->isElementExists("gdf_test_child-name")) {
110
-            $this->logError("GDF child theme not installed");
111
-            $stop_script = true;
112
-        }
113
-
114
-        if($stop_script) {
115
-            $this->logError("Stopping the script. Please fix the errors to continue");
116
-            return;
117
-        }
118
-
119
-        //Activate GDF theme if not active
120
-        $this->logInfo('Checking GDF theme......');
121
-        $is_active = $this->byXPath("//div[contains(@class, 'theme') and contains(@class, 'active')]")->attribute('aria-describedby');
122
-        if (strpos($is_active, 'gdf_test_child-name')) {
123
-            //GDF already active
124
-        } else {
125
-            //Activate GDF
126
-            $this->logInfo('Activating GDF theme......');
127
-            $this->byXPath("//div[contains(@aria-describedby, 'gdf_test_child-action') and contains(@aria-describedby, 'gdf_test_child-name')]//div[@class='theme-actions']//a[contains(@class, 'activate')]")->click();
128
-            $this->waitForPageLoadAndCheckForErrors();
129
-            $this->assertTrue( $this->isTextPresent("New theme activated"), "'New theme activated' text not found");
130
-        }
131
-
132
-        //Activate Geodirectory core
133
-        $this->maybeActivatePlugin("geodirectory", 20000);
134
-
135
-        //set default location
136
-        $this->logInfo('Setting default location......');
137
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=default_location_settings');
138
-        $this->waitForPageLoadAndCheckForErrors();
139
-        $this->byId('city')->value('New York');
140
-        $this->byId('set_address_button')->click();
141
-        $this->waitForPageLoadAndCheckForErrors();
142
-        $this->byId('location_save')->click();
143
-        $this->waitForPageLoadAndCheckForErrors();
144
-        $this->assertTrue( $this->isTextPresent("Your settings have been saved"), "'Your settings have been saved' text not found");
145
-        $this->waitForPageLoadAndCheckForErrors();
146
-
147
-        //install place dummy data
148
-        $this->logInfo('Installing place dummy data......');
149
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory');
150
-        $this->waitForPageLoadAndCheckForErrors();
151
-        //$this->byLinkText('Dummy Data')->click();
152
-        $this->byXPath("//dd[@id='dummy_data_settings']/a")->click();
153
-        $html = $this->byId('sub_dummy_data_settings')->attribute('innerHTML');
154
-        if (strpos($html, 'Yes Delete Please!')) {
155
-            //delete old place data
156
-            $this->byXPath("//div[@id='sub_dummy_data_settings']//a[@id='geodir_dummy_delete']")->click();
157
-            $this->acceptAlert();
158
-            $this->waitForPageLoadAndCheckForErrors();
159
-        }
160
-        $this->select($this->byXPath("//div[@id='sub_dummy_data_settings']//select[@class='selected_sample_data']"))->selectOptionByLabel('10');
161
-        $this->byXPath("//div[@id='sub_dummy_data_settings']//a[@id='geodir_dummy_insert']")->click();
162
-        $this->waitForPageLoadAndCheckForErrors(60000);
163
-
164
-        //make sure dummy data installed
165
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory');
166
-        $this->waitForPageLoadAndCheckForErrors();
167
-        $this->byXPath("//dd[@id='dummy_data_settings']/a")->click();
168
-        $html = $this->byId('sub_dummy_data_settings')->attribute('innerHTML');
169
-        $this->assertTrue( is_int(strpos($html, 'Yes Delete Please!')), "Places Demo data not installed correctly");
170
-
171
-
172
-        //Activate Geodirectory Events
173
-        $this->maybeActivatePlugin("geodirectory-events", 20000);
174
-
175
-        //install Events dummy data
176
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory');
177
-        $this->waitForPageLoadAndCheckForErrors();
178
-        $this->byXPath("//dd[@id='gdevent_dummy_data_settings']/a")->click();
179
-        $html = $this->byId('sub_gdevent_dummy_data_settings')->attribute('innerHTML');
180
-        if (strpos($html, 'Yes Delete Please!')) {
181
-            //delete old data
182
-            $this->byXPath("//div[@id='sub_gdevent_dummy_data_settings']//a[@id='geodir_dummy_delete']")->click();
183
-            $this->acceptAlert();
184
-            $this->waitForPageLoadAndCheckForErrors();
185
-        }
186
-        $this->select($this->byXPath("//div[@id='sub_gdevent_dummy_data_settings']//select[@class='selected_sample_data']"))->selectOptionByLabel('10');
187
-        $this->byXPath("//div[@id='sub_gdevent_dummy_data_settings']//a[@id='geodir_dummy_insert']")->click();
188
-        $this->waitForPageLoadAndCheckForErrors(60000);
189
-
190
-        //make sure Events dummy data installed
191
-        $this->logInfo('Checking events dummy data installed properly or not......');
192
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=general_settings&active_tab=gdevent_dummy_data_settings');
193
-        $this->waitForPageLoadAndCheckForErrors();
194
-        $this->byXPath("//dd[@id='gdevent_dummy_data_settings']/a")->click();
195
-        $html = $this->byId('sub_gdevent_dummy_data_settings')->attribute('innerHTML');
196
-        $this->assertTrue( is_int(strpos($html, 'Yes Delete Please!')), "Events Demo data not installed correctly");
197
-
198
-        //set home page
199
-        $this->logInfo('Setting home page......');
200
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/options-reading.php');
201
-        $this->waitForPageLoadAndCheckForErrors();
202
-        $this->byXPath("//input[@value='page']")->click();
203
-        $this->select($this->byId("page_on_front"))->selectOptionByLabel('GD Home page');
204
-        $this->byId("submit")->click();
205
-        $this->waitForPageLoadAndCheckForErrors();
206
-        $this->assertTrue( $this->isTextPresent("Settings saved"), "'Settings saved' text not found");
207
-
208
-        //Enable registration
209
-        $this->logInfo('Enabling registration......');
210
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/options-general.php');
211
-        $this->waitForPageLoadAndCheckForErrors();
212
-        $this->byId("users_can_register")->click();
213
-        $this->byId("submit")->click();
214
-        $this->waitForPageLoadAndCheckForErrors();
215
-        $this->assertTrue( $this->isTextPresent("Settings saved"), "'Settings saved' text not found");
216
-
217
-        //Permalinks
218
-        $this->logInfo('Setting permalinks......');
219
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/options-permalink.php');
220
-        $this->waitForPageLoadAndCheckForErrors();
221
-        $this->byXPath("(//input[@name='selection'])[5]")->click();
222
-        $this->byId("submit")->click();
223
-        $this->waitForPageLoadAndCheckForErrors();
87
+		foreach ($plugins as $plugin) {
88
+			if (!is_int(strpos($this->byId($plugin)->attribute('class'), 'inactive'))) {
89
+				$plugin_name = ucwords(str_replace('-', ' ', $plugin));
90
+				$this->logError($plugin_name." is active. Please deactivate it. It will be activated programatically.");
91
+				$stop_script = true;
92
+			}
93
+		}
94
+
95
+
96
+		if($stop_script) {
97
+			$this->logInfo("Stopping the script. Please fix the errors to continue");
98
+			return;
99
+		}
100
+
101
+		//make sure GDF theme installed
102
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/themes.php');
103
+		$this->waitForPageLoadAndCheckForErrors();
104
+		if (!$this->isElementExists("GeoDirectory_framework-name")) {
105
+			$this->logError("GeoDirectory Framework theme not installed");
106
+			$stop_script = true;
107
+		}
108
+
109
+		if (!$this->isElementExists("gdf_test_child-name")) {
110
+			$this->logError("GDF child theme not installed");
111
+			$stop_script = true;
112
+		}
113
+
114
+		if($stop_script) {
115
+			$this->logError("Stopping the script. Please fix the errors to continue");
116
+			return;
117
+		}
118
+
119
+		//Activate GDF theme if not active
120
+		$this->logInfo('Checking GDF theme......');
121
+		$is_active = $this->byXPath("//div[contains(@class, 'theme') and contains(@class, 'active')]")->attribute('aria-describedby');
122
+		if (strpos($is_active, 'gdf_test_child-name')) {
123
+			//GDF already active
124
+		} else {
125
+			//Activate GDF
126
+			$this->logInfo('Activating GDF theme......');
127
+			$this->byXPath("//div[contains(@aria-describedby, 'gdf_test_child-action') and contains(@aria-describedby, 'gdf_test_child-name')]//div[@class='theme-actions']//a[contains(@class, 'activate')]")->click();
128
+			$this->waitForPageLoadAndCheckForErrors();
129
+			$this->assertTrue( $this->isTextPresent("New theme activated"), "'New theme activated' text not found");
130
+		}
131
+
132
+		//Activate Geodirectory core
133
+		$this->maybeActivatePlugin("geodirectory", 20000);
134
+
135
+		//set default location
136
+		$this->logInfo('Setting default location......');
137
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=default_location_settings');
138
+		$this->waitForPageLoadAndCheckForErrors();
139
+		$this->byId('city')->value('New York');
140
+		$this->byId('set_address_button')->click();
141
+		$this->waitForPageLoadAndCheckForErrors();
142
+		$this->byId('location_save')->click();
143
+		$this->waitForPageLoadAndCheckForErrors();
144
+		$this->assertTrue( $this->isTextPresent("Your settings have been saved"), "'Your settings have been saved' text not found");
145
+		$this->waitForPageLoadAndCheckForErrors();
146
+
147
+		//install place dummy data
148
+		$this->logInfo('Installing place dummy data......');
149
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory');
150
+		$this->waitForPageLoadAndCheckForErrors();
151
+		//$this->byLinkText('Dummy Data')->click();
152
+		$this->byXPath("//dd[@id='dummy_data_settings']/a")->click();
153
+		$html = $this->byId('sub_dummy_data_settings')->attribute('innerHTML');
154
+		if (strpos($html, 'Yes Delete Please!')) {
155
+			//delete old place data
156
+			$this->byXPath("//div[@id='sub_dummy_data_settings']//a[@id='geodir_dummy_delete']")->click();
157
+			$this->acceptAlert();
158
+			$this->waitForPageLoadAndCheckForErrors();
159
+		}
160
+		$this->select($this->byXPath("//div[@id='sub_dummy_data_settings']//select[@class='selected_sample_data']"))->selectOptionByLabel('10');
161
+		$this->byXPath("//div[@id='sub_dummy_data_settings']//a[@id='geodir_dummy_insert']")->click();
162
+		$this->waitForPageLoadAndCheckForErrors(60000);
163
+
164
+		//make sure dummy data installed
165
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory');
166
+		$this->waitForPageLoadAndCheckForErrors();
167
+		$this->byXPath("//dd[@id='dummy_data_settings']/a")->click();
168
+		$html = $this->byId('sub_dummy_data_settings')->attribute('innerHTML');
169
+		$this->assertTrue( is_int(strpos($html, 'Yes Delete Please!')), "Places Demo data not installed correctly");
170
+
171
+
172
+		//Activate Geodirectory Events
173
+		$this->maybeActivatePlugin("geodirectory-events", 20000);
174
+
175
+		//install Events dummy data
176
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory');
177
+		$this->waitForPageLoadAndCheckForErrors();
178
+		$this->byXPath("//dd[@id='gdevent_dummy_data_settings']/a")->click();
179
+		$html = $this->byId('sub_gdevent_dummy_data_settings')->attribute('innerHTML');
180
+		if (strpos($html, 'Yes Delete Please!')) {
181
+			//delete old data
182
+			$this->byXPath("//div[@id='sub_gdevent_dummy_data_settings']//a[@id='geodir_dummy_delete']")->click();
183
+			$this->acceptAlert();
184
+			$this->waitForPageLoadAndCheckForErrors();
185
+		}
186
+		$this->select($this->byXPath("//div[@id='sub_gdevent_dummy_data_settings']//select[@class='selected_sample_data']"))->selectOptionByLabel('10');
187
+		$this->byXPath("//div[@id='sub_gdevent_dummy_data_settings']//a[@id='geodir_dummy_insert']")->click();
188
+		$this->waitForPageLoadAndCheckForErrors(60000);
189
+
190
+		//make sure Events dummy data installed
191
+		$this->logInfo('Checking events dummy data installed properly or not......');
192
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=general_settings&active_tab=gdevent_dummy_data_settings');
193
+		$this->waitForPageLoadAndCheckForErrors();
194
+		$this->byXPath("//dd[@id='gdevent_dummy_data_settings']/a")->click();
195
+		$html = $this->byId('sub_gdevent_dummy_data_settings')->attribute('innerHTML');
196
+		$this->assertTrue( is_int(strpos($html, 'Yes Delete Please!')), "Events Demo data not installed correctly");
197
+
198
+		//set home page
199
+		$this->logInfo('Setting home page......');
200
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/options-reading.php');
201
+		$this->waitForPageLoadAndCheckForErrors();
202
+		$this->byXPath("//input[@value='page']")->click();
203
+		$this->select($this->byId("page_on_front"))->selectOptionByLabel('GD Home page');
204
+		$this->byId("submit")->click();
205
+		$this->waitForPageLoadAndCheckForErrors();
206
+		$this->assertTrue( $this->isTextPresent("Settings saved"), "'Settings saved' text not found");
207
+
208
+		//Enable registration
209
+		$this->logInfo('Enabling registration......');
210
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/options-general.php');
211
+		$this->waitForPageLoadAndCheckForErrors();
212
+		$this->byId("users_can_register")->click();
213
+		$this->byId("submit")->click();
214
+		$this->waitForPageLoadAndCheckForErrors();
215
+		$this->assertTrue( $this->isTextPresent("Settings saved"), "'Settings saved' text not found");
216
+
217
+		//Permalinks
218
+		$this->logInfo('Setting permalinks......');
219
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/options-permalink.php');
220
+		$this->waitForPageLoadAndCheckForErrors();
221
+		$this->byXPath("(//input[@name='selection'])[5]")->click();
222
+		$this->byId("submit")->click();
223
+		$this->waitForPageLoadAndCheckForErrors();
224 224
 //        echo $this->source();
225
-        $this->assertTrue( $this->isTextPresent("Permalink structure updated"), "'Permalink structure updated' text not found");
226
-
227
-        //create and assign menu
228
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/nav-menus.php');
229
-        $this->waitForPageLoadAndCheckForErrors();
230
-        $this->assertTrue( $this->isTextPresent("Give your menu a name above, then click Create Menu."), "'Create Menu' text not found");
231
-        $this->logInfo('Creating new menu......');
232
-        $this->byId('menu-name')->value('Primary');
233
-        $this->byId('save_menu_header')->click();
234
-        $this->waitForPageLoadAndCheckForErrors();
235
-
236
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/nav-menus.php');
237
-        $this->waitForPageLoadAndCheckForErrors();
238
-        $this->assertTrue( $this->isTextPresent("Add menu items from the column on the left"), "'Add menu items from the column on the left' text not found");
239
-        $this->logInfo('Setting menu location......');
240
-        $this->byId('locations-main-nav')->click();
241
-        $this->byId('save_menu_header')->click();
242
-        $this->waitForPageLoadAndCheckForErrors();
243
-        $this->assertTrue( $this->isTextPresent("<strong>Primary</strong> has been updated"), "'Primary has been updated' text not found");
244
-
245
-        // Assign menu
246
-        $this->logInfo('Assigning menu......');
247
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=design_settings&active_tab=geodir_navigation_settings');
248
-        $this->ExecuteScript('jQuery("#geodir_theme_location_nav").show();');
249
-        $this->select($this->byId('geodir_theme_location_nav'))->selectOptionByLabel('The Main Menu');
250
-        $this->byName('save')->click();
251
-        $this->waitForPageLoadAndCheckForErrors();
252
-
253
-        //Logout
254
-        $this->maybeAdminLogout();
255
-    }
256
-
257
-    public function tearDown()
258
-    {
259
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
260
-            //write current file number to completed.txt
261
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
262
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
263
-            fwrite($completed, $CurrentFileNumber);
264
-        }
265
-    }
225
+		$this->assertTrue( $this->isTextPresent("Permalink structure updated"), "'Permalink structure updated' text not found");
226
+
227
+		//create and assign menu
228
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/nav-menus.php');
229
+		$this->waitForPageLoadAndCheckForErrors();
230
+		$this->assertTrue( $this->isTextPresent("Give your menu a name above, then click Create Menu."), "'Create Menu' text not found");
231
+		$this->logInfo('Creating new menu......');
232
+		$this->byId('menu-name')->value('Primary');
233
+		$this->byId('save_menu_header')->click();
234
+		$this->waitForPageLoadAndCheckForErrors();
235
+
236
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/nav-menus.php');
237
+		$this->waitForPageLoadAndCheckForErrors();
238
+		$this->assertTrue( $this->isTextPresent("Add menu items from the column on the left"), "'Add menu items from the column on the left' text not found");
239
+		$this->logInfo('Setting menu location......');
240
+		$this->byId('locations-main-nav')->click();
241
+		$this->byId('save_menu_header')->click();
242
+		$this->waitForPageLoadAndCheckForErrors();
243
+		$this->assertTrue( $this->isTextPresent("<strong>Primary</strong> has been updated"), "'Primary has been updated' text not found");
244
+
245
+		// Assign menu
246
+		$this->logInfo('Assigning menu......');
247
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=design_settings&active_tab=geodir_navigation_settings');
248
+		$this->ExecuteScript('jQuery("#geodir_theme_location_nav").show();');
249
+		$this->select($this->byId('geodir_theme_location_nav'))->selectOptionByLabel('The Main Menu');
250
+		$this->byName('save')->click();
251
+		$this->waitForPageLoadAndCheckForErrors();
252
+
253
+		//Logout
254
+		$this->maybeAdminLogout();
255
+	}
256
+
257
+	public function tearDown()
258
+	{
259
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
260
+			//write current file number to completed.txt
261
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
262
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
263
+			fwrite($completed, $CurrentFileNumber);
264
+		}
265
+	}
266 266
 
267 267
 }
268 268
 ?>
269 269
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             }
53 53
         }
54 54
 
55
-        if($stop_script) {
55
+        if ($stop_script) {
56 56
             $this->logError("Stopping the script. Please fix the errors to continue");
57 57
             return;
58 58
         }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         }
94 94
 
95 95
 
96
-        if($stop_script) {
96
+        if ($stop_script) {
97 97
             $this->logInfo("Stopping the script. Please fix the errors to continue");
98 98
             return;
99 99
         }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             $stop_script = true;
112 112
         }
113 113
 
114
-        if($stop_script) {
114
+        if ($stop_script) {
115 115
             $this->logError("Stopping the script. Please fix the errors to continue");
116 116
             return;
117 117
         }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             $this->logInfo('Activating GDF theme......');
127 127
             $this->byXPath("//div[contains(@aria-describedby, 'gdf_test_child-action') and contains(@aria-describedby, 'gdf_test_child-name')]//div[@class='theme-actions']//a[contains(@class, 'activate')]")->click();
128 128
             $this->waitForPageLoadAndCheckForErrors();
129
-            $this->assertTrue( $this->isTextPresent("New theme activated"), "'New theme activated' text not found");
129
+            $this->assertTrue($this->isTextPresent("New theme activated"), "'New theme activated' text not found");
130 130
         }
131 131
 
132 132
         //Activate Geodirectory core
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $this->waitForPageLoadAndCheckForErrors();
142 142
         $this->byId('location_save')->click();
143 143
         $this->waitForPageLoadAndCheckForErrors();
144
-        $this->assertTrue( $this->isTextPresent("Your settings have been saved"), "'Your settings have been saved' text not found");
144
+        $this->assertTrue($this->isTextPresent("Your settings have been saved"), "'Your settings have been saved' text not found");
145 145
         $this->waitForPageLoadAndCheckForErrors();
146 146
 
147 147
         //install place dummy data
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $this->waitForPageLoadAndCheckForErrors();
167 167
         $this->byXPath("//dd[@id='dummy_data_settings']/a")->click();
168 168
         $html = $this->byId('sub_dummy_data_settings')->attribute('innerHTML');
169
-        $this->assertTrue( is_int(strpos($html, 'Yes Delete Please!')), "Places Demo data not installed correctly");
169
+        $this->assertTrue(is_int(strpos($html, 'Yes Delete Please!')), "Places Demo data not installed correctly");
170 170
 
171 171
 
172 172
         //Activate Geodirectory Events
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         $this->waitForPageLoadAndCheckForErrors();
194 194
         $this->byXPath("//dd[@id='gdevent_dummy_data_settings']/a")->click();
195 195
         $html = $this->byId('sub_gdevent_dummy_data_settings')->attribute('innerHTML');
196
-        $this->assertTrue( is_int(strpos($html, 'Yes Delete Please!')), "Events Demo data not installed correctly");
196
+        $this->assertTrue(is_int(strpos($html, 'Yes Delete Please!')), "Events Demo data not installed correctly");
197 197
 
198 198
         //set home page
199 199
         $this->logInfo('Setting home page......');
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         $this->select($this->byId("page_on_front"))->selectOptionByLabel('GD Home page');
204 204
         $this->byId("submit")->click();
205 205
         $this->waitForPageLoadAndCheckForErrors();
206
-        $this->assertTrue( $this->isTextPresent("Settings saved"), "'Settings saved' text not found");
206
+        $this->assertTrue($this->isTextPresent("Settings saved"), "'Settings saved' text not found");
207 207
 
208 208
         //Enable registration
209 209
         $this->logInfo('Enabling registration......');
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         $this->byId("users_can_register")->click();
213 213
         $this->byId("submit")->click();
214 214
         $this->waitForPageLoadAndCheckForErrors();
215
-        $this->assertTrue( $this->isTextPresent("Settings saved"), "'Settings saved' text not found");
215
+        $this->assertTrue($this->isTextPresent("Settings saved"), "'Settings saved' text not found");
216 216
 
217 217
         //Permalinks
218 218
         $this->logInfo('Setting permalinks......');
@@ -222,12 +222,12 @@  discard block
 block discarded – undo
222 222
         $this->byId("submit")->click();
223 223
         $this->waitForPageLoadAndCheckForErrors();
224 224
 //        echo $this->source();
225
-        $this->assertTrue( $this->isTextPresent("Permalink structure updated"), "'Permalink structure updated' text not found");
225
+        $this->assertTrue($this->isTextPresent("Permalink structure updated"), "'Permalink structure updated' text not found");
226 226
 
227 227
         //create and assign menu
228 228
         $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/nav-menus.php');
229 229
         $this->waitForPageLoadAndCheckForErrors();
230
-        $this->assertTrue( $this->isTextPresent("Give your menu a name above, then click Create Menu."), "'Create Menu' text not found");
230
+        $this->assertTrue($this->isTextPresent("Give your menu a name above, then click Create Menu."), "'Create Menu' text not found");
231 231
         $this->logInfo('Creating new menu......');
232 232
         $this->byId('menu-name')->value('Primary');
233 233
         $this->byId('save_menu_header')->click();
@@ -235,12 +235,12 @@  discard block
 block discarded – undo
235 235
 
236 236
         $this->url(self::GDTEST_BASE_URL.'wp-admin/nav-menus.php');
237 237
         $this->waitForPageLoadAndCheckForErrors();
238
-        $this->assertTrue( $this->isTextPresent("Add menu items from the column on the left"), "'Add menu items from the column on the left' text not found");
238
+        $this->assertTrue($this->isTextPresent("Add menu items from the column on the left"), "'Add menu items from the column on the left' text not found");
239 239
         $this->logInfo('Setting menu location......');
240 240
         $this->byId('locations-main-nav')->click();
241 241
         $this->byId('save_menu_header')->click();
242 242
         $this->waitForPageLoadAndCheckForErrors();
243
-        $this->assertTrue( $this->isTextPresent("<strong>Primary</strong> has been updated"), "'Primary has been updated' text not found");
243
+        $this->assertTrue($this->isTextPresent("<strong>Primary</strong> has been updated"), "'Primary has been updated' text not found");
244 244
 
245 245
         // Assign menu
246 246
         $this->logInfo('Assigning menu......');
Please login to merge, or discard this patch.
tests/selenium/stest-33_Stripe.php 2 patches
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -1,79 +1,79 @@
 block discarded – undo
1 1
 <?php
2 2
 class Stripe extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7 7
 
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16 16
 
17
-    public function testStripe()
18
-    {
19
-        $this->logInfo('Testing stripe......');
20
-        //make sure Stripe payment plugin active
21
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
22
-        $this->waitForPageLoadAndCheckForErrors();
17
+	public function testStripe()
18
+	{
19
+		$this->logInfo('Testing stripe......');
20
+		//make sure Stripe payment plugin active
21
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
22
+		$this->waitForPageLoadAndCheckForErrors();
23 23
 
24
-        $is_active = $this->byId("stripe-payment-geodirectory-add-on")->attribute('class');
25
-        if (is_int(strpos($is_active, 'inactive'))) {
26
-            //Activate Geodirectory stripe payment geodirectory add on
27
-            $this->maybeActivatePlugin("stripe-payment-geodirectory-add-on", 20000);
28
-            //go back to plugin page
29
-            $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
30
-        }
24
+		$is_active = $this->byId("stripe-payment-geodirectory-add-on")->attribute('class');
25
+		if (is_int(strpos($is_active, 'inactive'))) {
26
+			//Activate Geodirectory stripe payment geodirectory add on
27
+			$this->maybeActivatePlugin("stripe-payment-geodirectory-add-on", 20000);
28
+			//go back to plugin page
29
+			$this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
30
+		}
31 31
 
32
-        $is_active1 = $this->byId("stripe-payment-geodirectory-add-on")->attribute('class');
33
-        $this->assertFalse( strpos($is_active1, 'inactive'), "stripe payment geodirectory add on plugin not active");
32
+		$is_active1 = $this->byId("stripe-payment-geodirectory-add-on")->attribute('class');
33
+		$this->assertFalse( strpos($is_active1, 'inactive'), "stripe payment geodirectory add on plugin not active");
34 34
 
35 35
 
36
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=paymentmanager_fields&subtab=geodir_payment_options');
37
-        $this->waitForPageLoadAndCheckForErrors();
36
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=paymentmanager_fields&subtab=geodir_payment_options');
37
+		$this->waitForPageLoadAndCheckForErrors();
38 38
 
39
-        $this->url(self::GDTEST_BASE_URL.'author/admin/?geodir_dashbord=true&stype=gd_place');
40
-        $this->waitForPageLoadAndCheckForErrors();
41
-        $this->byClassName('geodir-upgrade')->click();
42
-        $this->waitForPageLoadAndCheckForErrors();
43
-        $this->byXPath("(//div[@class='geodir_package']/input[@type='radio'])[2]")->click();
44
-        $this->waitForPageLoadAndCheckForErrors();
45
-        if ($this->isTextPresent("Business Owner/Associate")) {
39
+		$this->url(self::GDTEST_BASE_URL.'author/admin/?geodir_dashbord=true&stype=gd_place');
40
+		$this->waitForPageLoadAndCheckForErrors();
41
+		$this->byClassName('geodir-upgrade')->click();
42
+		$this->waitForPageLoadAndCheckForErrors();
43
+		$this->byXPath("(//div[@class='geodir_package']/input[@type='radio'])[2]")->click();
44
+		$this->waitForPageLoadAndCheckForErrors();
45
+		if ($this->isTextPresent("Business Owner/Associate")) {
46 46
 //            $elements = $this->elements($this->using('name')->value('claimed'));
47 47
 //            $elements[0]->click();
48 48
 //            $this->byXPath("//input[contains(@name,'claimed') and contains(@value,'0')]")->click();
49
-            $this->ExecuteScript('jQuery("#geodir_claimed_row input:radio:first").prop("checked", true).trigger("click");');
50
-        }
51
-        $this->byId('geodir_accept_term_condition')->click();
52
-        $this->byXPath("//div[@id='geodir-add-listing-submit']//input[@type='submit']")->click();
53
-        $this->waitForPageLoadAndCheckForErrors();
54
-        $this->byXPath("//input[@name='Submit and Pay']")->click();
55
-        $this->waitForPageLoadAndCheckForErrors();
56
-        $this->ExecuteScript('jQuery("#gd_pmethod_stripe").prop("checked", true).trigger("click");');
57
-        $this->waitForPageLoadAndCheckForErrors();
58
-        $this->byId('gd_checkout_paynow')->click();
49
+			$this->ExecuteScript('jQuery("#geodir_claimed_row input:radio:first").prop("checked", true).trigger("click");');
50
+		}
51
+		$this->byId('geodir_accept_term_condition')->click();
52
+		$this->byXPath("//div[@id='geodir-add-listing-submit']//input[@type='submit']")->click();
53
+		$this->waitForPageLoadAndCheckForErrors();
54
+		$this->byXPath("//input[@name='Submit and Pay']")->click();
55
+		$this->waitForPageLoadAndCheckForErrors();
56
+		$this->ExecuteScript('jQuery("#gd_pmethod_stripe").prop("checked", true).trigger("click");');
57
+		$this->waitForPageLoadAndCheckForErrors();
58
+		$this->byId('gd_checkout_paynow')->click();
59 59
 //        $this->waitForPageLoadAndCheckForErrors();
60 60
 //        $this->byId('email')->value('[email protected]');
61 61
 //        $this->byId('card_number')->value('4242424242424242');
62 62
 //        $this->byId('cc-exp')->value('12 / 20');
63 63
 //        $this->byId('cc-csc')->value('333');
64 64
 //        $this->byId('submitButton')->click();
65
-        $this->logInfo('Skipping stripe payment since cross-site scripting not possible......');
66
-        $this->waitForPageLoadAndCheckForErrors();
67
-    }
65
+		$this->logInfo('Skipping stripe payment since cross-site scripting not possible......');
66
+		$this->waitForPageLoadAndCheckForErrors();
67
+	}
68 68
 
69
-    public function tearDown()
70
-    {
71
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
72
-            //write current file number to completed.txt
73
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
74
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
75
-            fwrite($completed, $CurrentFileNumber);
76
-        }
77
-    }
69
+	public function tearDown()
70
+	{
71
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
72
+			//write current file number to completed.txt
73
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
74
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
75
+			fwrite($completed, $CurrentFileNumber);
76
+		}
77
+	}
78 78
 }
79 79
 ?>
80 80
\ 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
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
         }
31 31
 
32 32
         $is_active1 = $this->byId("stripe-payment-geodirectory-add-on")->attribute('class');
33
-        $this->assertFalse( strpos($is_active1, 'inactive'), "stripe payment geodirectory add on plugin not active");
33
+        $this->assertFalse(strpos($is_active1, 'inactive'), "stripe payment geodirectory add on plugin not active");
34 34
 
35 35
 
36 36
         $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=paymentmanager_fields&subtab=geodir_payment_options');
Please login to merge, or discard this patch.
tests/selenium/stest-02_Login.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,45 +1,45 @@
 block discarded – undo
1 1
 <?php
2 2
 class LoginUser extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7 7
 
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16 16
 
17
-    public function testLogin()
18
-    {
19
-        $this->logInfo('Logging in new user......');
20
-        $this->url(self::GDTEST_BASE_URL.'gd-login/?signup=1');
21
-        $this->waitForPageLoadAndCheckForErrors();
22
-        $this->assertTrue( $this->isTextPresent("Sign In"), "No text found");
23
-        $this->byId('user_login')->value('[email protected]');
24
-        $this->byId('user_pass')->value('1');
17
+	public function testLogin()
18
+	{
19
+		$this->logInfo('Logging in new user......');
20
+		$this->url(self::GDTEST_BASE_URL.'gd-login/?signup=1');
21
+		$this->waitForPageLoadAndCheckForErrors();
22
+		$this->assertTrue( $this->isTextPresent("Sign In"), "No text found");
23
+		$this->byId('user_login')->value('[email protected]');
24
+		$this->byId('user_pass')->value('1');
25 25
 //        $this->byId('rememberme')->click();
26
-        // Submit the form
27
-        $this->byId('cus_loginform')->submit();
28
-        $this->waitForPageLoadAndCheckForErrors();
29
-        $this->assertFalse( $this->isTextPresent("Invalid Username/Password."), "Invalid Username/Password.");
30
-        $this->assertTrue( $this->isTextPresent("Add Listing"), "Add Listing text not found");
26
+		// Submit the form
27
+		$this->byId('cus_loginform')->submit();
28
+		$this->waitForPageLoadAndCheckForErrors();
29
+		$this->assertFalse( $this->isTextPresent("Invalid Username/Password."), "Invalid Username/Password.");
30
+		$this->assertTrue( $this->isTextPresent("Add Listing"), "Add Listing text not found");
31 31
 
32
-    }
32
+	}
33 33
 
34
-    public function tearDown()
35
-    {
36
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
37
-            //write current file number to completed.txt
38
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
39
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
40
-            fwrite($completed, $CurrentFileNumber);
41
-        }
42
-    }
34
+	public function tearDown()
35
+	{
36
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
37
+			//write current file number to completed.txt
38
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
39
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
40
+			fwrite($completed, $CurrentFileNumber);
41
+		}
42
+	}
43 43
 
44 44
 }
45 45
 ?>
46 46
\ 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
@@ -19,15 +19,15 @@
 block discarded – undo
19 19
         $this->logInfo('Logging in new user......');
20 20
         $this->url(self::GDTEST_BASE_URL.'gd-login/?signup=1');
21 21
         $this->waitForPageLoadAndCheckForErrors();
22
-        $this->assertTrue( $this->isTextPresent("Sign In"), "No text found");
22
+        $this->assertTrue($this->isTextPresent("Sign In"), "No text found");
23 23
         $this->byId('user_login')->value('[email protected]');
24 24
         $this->byId('user_pass')->value('1');
25 25
 //        $this->byId('rememberme')->click();
26 26
         // Submit the form
27 27
         $this->byId('cus_loginform')->submit();
28 28
         $this->waitForPageLoadAndCheckForErrors();
29
-        $this->assertFalse( $this->isTextPresent("Invalid Username/Password."), "Invalid Username/Password.");
30
-        $this->assertTrue( $this->isTextPresent("Add Listing"), "Add Listing text not found");
29
+        $this->assertFalse($this->isTextPresent("Invalid Username/Password."), "Invalid Username/Password.");
30
+        $this->assertTrue($this->isTextPresent("Add Listing"), "Add Listing text not found");
31 31
 
32 32
     }
33 33
 
Please login to merge, or discard this patch.
tests/selenium/stest-31_ReCaptcha.php 2 patches
Indentation   +189 added lines, -189 removed lines patch added patch discarded remove patch
@@ -1,194 +1,194 @@
 block discarded – undo
1 1
 <?php
2 2
 class ReCaptcha extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
16
-
17
-    public function testReCaptcha()
18
-    {
19
-        $this->logInfo('Testing recaptcha......');
20
-        //make sure ReCaptcha plugin active
21
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
22
-        $this->waitForPageLoadAndCheckForErrors();
23
-
24
-        $is_active = $this->byId("geodirectory-re-captcha")->attribute('class');
25
-        if (is_int(strpos($is_active, 'inactive'))) {
26
-            //Activate Geodirectory ReCaptcha
27
-            $this->maybeActivatePlugin("geodirectory-re-captcha", 20000);
28
-            //go back to plugin page
29
-            $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
30
-        }
31
-
32
-        $is_active1 = $this->byId("geodirectory-re-captcha")->attribute('class');
33
-        $this->assertFalse( strpos($is_active1, 'inactive'), "ReCaptcha plugin not active");
34
-
35
-        //make sure BuddyPress core plugin active
36
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
37
-        $this->waitForPageLoadAndCheckForErrors();
38
-
39
-        $is_active = $this->byId("buddypress")->attribute('class');
40
-        if (is_int(strpos($is_active, 'inactive'))) {
41
-            //Activate Geodirectory buddypress
42
-            $this->maybeActivatePlugin("buddypress", 20000);
43
-            //go back to plugin page
44
-            $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
45
-        }
46
-
47
-        $is_active1 = $this->byId("buddypress")->attribute('class');
48
-        $this->assertFalse( strpos($is_active1, 'inactive'), "buddypress plugin not active");
49
-
50
-        //make sure BuddyPress Integration plugin active
51
-        $is_active = $this->byId("geodirectory-buddypress-integration")->attribute('class');
52
-        if (is_int(strpos($is_active, 'inactive'))) {
53
-            //Activate Geodirectory buddypress integration
54
-            $this->maybeActivatePlugin("geodirectory-buddypress-integration", 20000);
55
-            //go back to plugin page
56
-            $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
57
-        }
58
-
59
-        $is_active1 = $this->byId("geodirectory-buddypress-integration")->attribute('class');
60
-        $this->assertFalse( strpos($is_active1, 'inactive'), "geodirectory buddypress integration plugin not active");
61
-
62
-
63
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_recaptcha&subtab=gdcaptcha_settings');
64
-        $this->waitForPageLoadAndCheckForErrors();
65
-        $this->prepareSession()->currentWindow()->maximize();
66
-
67
-        $stop_script = false;
68
-
69
-        $public_key  = getenv( 'GOOGLE_RECAPTCHA_KEY' );
70
-        $private_key  = getenv( 'GOOGLE_RECAPTCHA_SECRET' );
71
-
72
-        if (!$public_key) {
73
-            $this->logError("ENV variable GOOGLE_RECAPTCHA_KEY not available");
74
-            $stop_script = true;
75
-        }
76
-
77
-        if (!$private_key) {
78
-            $this->logError("ENV variable GOOGLE_RECAPTCHA_KEY not available");
79
-            $stop_script = true;
80
-        }
81
-
82
-        if($stop_script) {
83
-            $this->logInfo("Stopping the script. Please fix the errors to continue");
84
-            return;
85
-        }
86
-
87
-        $value = $this->byId('geodir_recaptcha_site_key')->value();
88
-        if (empty($value)) {
89
-            $this->byId('geodir_recaptcha_site_key')->value($public_key);
90
-        }
91
-
92
-        $value = $this->byId('geodir_recaptcha_secret_key')->value();
93
-        if (empty($value)) {
94
-            $this->byId('geodir_recaptcha_secret_key')->value($private_key);
95
-        }
96
-
97
-
98
-        $to_save = false;
99
-
100
-        $options = array(
101
-            'geodir_recaptcha_registration',
102
-            'geodir_recaptcha_add_listing',
103
-            'geodir_recaptcha_claim_listing',
104
-            'geodir_recaptcha_comments',
105
-            'geodir_recaptcha_send_to_friend',
106
-            'geodir_recaptcha_send_enquery',
107
-            'geodir_recaptcha_buddypress'
108
-        );
109
-
110
-        foreach ($options as $option) {
111
-            $is_checked = $this->byId($option)->attribute('checked');
112
-            if (!$is_checked) {
113
-                $this->byId($option)->click();
114
-                $to_save = true;
115
-            }
116
-        }
117
-
118
-        if ($to_save) {
119
-            $this->byName('save')->click();
120
-            $this->waitForPageLoadAndCheckForErrors();
121
-        }
122
-
123
-        $this->maybeLogout();
124
-        //Signup
125
-        $this->url(self::GDTEST_BASE_URL.'gd-login/?signup=1');
126
-        $this->waitForPageLoadAndCheckForErrors();
127
-        $this->assertTrue( $this->isTextPresent("Sign Up Now"), "Not in signup page");
128
-        $this->waitForPageLoadAndCheckForErrors();
129
-        $this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
130
-        $this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in signup page");
131
-
132
-        //Add Listing
133
-        $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place');
134
-        $this->waitForPageLoadAndCheckForErrors();
135
-        if ($this->isTextPresent("Sign In")) {
136
-            $this->byId('user_login')->value('[email protected]');
137
-            $this->byId('user_pass')->value('1');
138
-            $this->byId('rememberme')->click();
139
-            // Submit the form
140
-            $this->byId('cus_loginform')->submit();
141
-            $this->waitForPageLoadAndCheckForErrors();
142
-            $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place');
143
-        }
144
-        $this->assertTrue( $this->isTextPresent("Add Place"), "Not in Add Listing page");
145
-        $this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
146
-        $this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in Add Listing page");
147
-
148
-        //claim
149
-        $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/');
150
-        $this->waitForPageLoadAndCheckForErrors();
151
-        $this->byId('gd-claim-button')->click();
152
-        $this->waitForPageLoadAndCheckForErrors();
153
-        $this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
154
-        $this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in claim form");
155
-
156
-        //reviews
157
-        $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/');
158
-        $this->waitForPageLoadAndCheckForErrors();
159
-        $this->byLinkText('Reviews')->click();
160
-        $this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
161
-        $this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in reviews form");
162
-
163
-        //send enquiry
164
-        $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/');
165
-        $this->waitForPageLoadAndCheckForErrors();
166
-        $this->byClassName('b_send_inquiry')->click();
167
-        $this->waitForPageLoadAndCheckForErrors();
168
-        $this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
169
-        $this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in Send Enquiry form");
170
-
171
-        //send to friend
172
-        $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/');
173
-        $this->waitForPageLoadAndCheckForErrors();
174
-        $this->byClassName('b_sendtofriend')->click();
175
-        $this->waitForPageLoadAndCheckForErrors();
176
-        $this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
177
-        $this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in Send To Friend form");
178
-
179
-        //buddypress
180
-        //Todo: assert buddypress page
181
-
182
-    }
183
-
184
-    public function tearDown()
185
-    {
186
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
187
-            //write current file number to completed.txt
188
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
189
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
190
-            fwrite($completed, $CurrentFileNumber);
191
-        }
192
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16
+
17
+	public function testReCaptcha()
18
+	{
19
+		$this->logInfo('Testing recaptcha......');
20
+		//make sure ReCaptcha plugin active
21
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
22
+		$this->waitForPageLoadAndCheckForErrors();
23
+
24
+		$is_active = $this->byId("geodirectory-re-captcha")->attribute('class');
25
+		if (is_int(strpos($is_active, 'inactive'))) {
26
+			//Activate Geodirectory ReCaptcha
27
+			$this->maybeActivatePlugin("geodirectory-re-captcha", 20000);
28
+			//go back to plugin page
29
+			$this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
30
+		}
31
+
32
+		$is_active1 = $this->byId("geodirectory-re-captcha")->attribute('class');
33
+		$this->assertFalse( strpos($is_active1, 'inactive'), "ReCaptcha plugin not active");
34
+
35
+		//make sure BuddyPress core plugin active
36
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
37
+		$this->waitForPageLoadAndCheckForErrors();
38
+
39
+		$is_active = $this->byId("buddypress")->attribute('class');
40
+		if (is_int(strpos($is_active, 'inactive'))) {
41
+			//Activate Geodirectory buddypress
42
+			$this->maybeActivatePlugin("buddypress", 20000);
43
+			//go back to plugin page
44
+			$this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
45
+		}
46
+
47
+		$is_active1 = $this->byId("buddypress")->attribute('class');
48
+		$this->assertFalse( strpos($is_active1, 'inactive'), "buddypress plugin not active");
49
+
50
+		//make sure BuddyPress Integration plugin active
51
+		$is_active = $this->byId("geodirectory-buddypress-integration")->attribute('class');
52
+		if (is_int(strpos($is_active, 'inactive'))) {
53
+			//Activate Geodirectory buddypress integration
54
+			$this->maybeActivatePlugin("geodirectory-buddypress-integration", 20000);
55
+			//go back to plugin page
56
+			$this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
57
+		}
58
+
59
+		$is_active1 = $this->byId("geodirectory-buddypress-integration")->attribute('class');
60
+		$this->assertFalse( strpos($is_active1, 'inactive'), "geodirectory buddypress integration plugin not active");
61
+
62
+
63
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_recaptcha&subtab=gdcaptcha_settings');
64
+		$this->waitForPageLoadAndCheckForErrors();
65
+		$this->prepareSession()->currentWindow()->maximize();
66
+
67
+		$stop_script = false;
68
+
69
+		$public_key  = getenv( 'GOOGLE_RECAPTCHA_KEY' );
70
+		$private_key  = getenv( 'GOOGLE_RECAPTCHA_SECRET' );
71
+
72
+		if (!$public_key) {
73
+			$this->logError("ENV variable GOOGLE_RECAPTCHA_KEY not available");
74
+			$stop_script = true;
75
+		}
76
+
77
+		if (!$private_key) {
78
+			$this->logError("ENV variable GOOGLE_RECAPTCHA_KEY not available");
79
+			$stop_script = true;
80
+		}
81
+
82
+		if($stop_script) {
83
+			$this->logInfo("Stopping the script. Please fix the errors to continue");
84
+			return;
85
+		}
86
+
87
+		$value = $this->byId('geodir_recaptcha_site_key')->value();
88
+		if (empty($value)) {
89
+			$this->byId('geodir_recaptcha_site_key')->value($public_key);
90
+		}
91
+
92
+		$value = $this->byId('geodir_recaptcha_secret_key')->value();
93
+		if (empty($value)) {
94
+			$this->byId('geodir_recaptcha_secret_key')->value($private_key);
95
+		}
96
+
97
+
98
+		$to_save = false;
99
+
100
+		$options = array(
101
+			'geodir_recaptcha_registration',
102
+			'geodir_recaptcha_add_listing',
103
+			'geodir_recaptcha_claim_listing',
104
+			'geodir_recaptcha_comments',
105
+			'geodir_recaptcha_send_to_friend',
106
+			'geodir_recaptcha_send_enquery',
107
+			'geodir_recaptcha_buddypress'
108
+		);
109
+
110
+		foreach ($options as $option) {
111
+			$is_checked = $this->byId($option)->attribute('checked');
112
+			if (!$is_checked) {
113
+				$this->byId($option)->click();
114
+				$to_save = true;
115
+			}
116
+		}
117
+
118
+		if ($to_save) {
119
+			$this->byName('save')->click();
120
+			$this->waitForPageLoadAndCheckForErrors();
121
+		}
122
+
123
+		$this->maybeLogout();
124
+		//Signup
125
+		$this->url(self::GDTEST_BASE_URL.'gd-login/?signup=1');
126
+		$this->waitForPageLoadAndCheckForErrors();
127
+		$this->assertTrue( $this->isTextPresent("Sign Up Now"), "Not in signup page");
128
+		$this->waitForPageLoadAndCheckForErrors();
129
+		$this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
130
+		$this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in signup page");
131
+
132
+		//Add Listing
133
+		$this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place');
134
+		$this->waitForPageLoadAndCheckForErrors();
135
+		if ($this->isTextPresent("Sign In")) {
136
+			$this->byId('user_login')->value('[email protected]');
137
+			$this->byId('user_pass')->value('1');
138
+			$this->byId('rememberme')->click();
139
+			// Submit the form
140
+			$this->byId('cus_loginform')->submit();
141
+			$this->waitForPageLoadAndCheckForErrors();
142
+			$this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place');
143
+		}
144
+		$this->assertTrue( $this->isTextPresent("Add Place"), "Not in Add Listing page");
145
+		$this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
146
+		$this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in Add Listing page");
147
+
148
+		//claim
149
+		$this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/');
150
+		$this->waitForPageLoadAndCheckForErrors();
151
+		$this->byId('gd-claim-button')->click();
152
+		$this->waitForPageLoadAndCheckForErrors();
153
+		$this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
154
+		$this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in claim form");
155
+
156
+		//reviews
157
+		$this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/');
158
+		$this->waitForPageLoadAndCheckForErrors();
159
+		$this->byLinkText('Reviews')->click();
160
+		$this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
161
+		$this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in reviews form");
162
+
163
+		//send enquiry
164
+		$this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/');
165
+		$this->waitForPageLoadAndCheckForErrors();
166
+		$this->byClassName('b_send_inquiry')->click();
167
+		$this->waitForPageLoadAndCheckForErrors();
168
+		$this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
169
+		$this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in Send Enquiry form");
170
+
171
+		//send to friend
172
+		$this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/');
173
+		$this->waitForPageLoadAndCheckForErrors();
174
+		$this->byClassName('b_sendtofriend')->click();
175
+		$this->waitForPageLoadAndCheckForErrors();
176
+		$this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
177
+		$this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in Send To Friend form");
178
+
179
+		//buddypress
180
+		//Todo: assert buddypress page
181
+
182
+	}
183
+
184
+	public function tearDown()
185
+	{
186
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
187
+			//write current file number to completed.txt
188
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
189
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
190
+			fwrite($completed, $CurrentFileNumber);
191
+		}
192
+	}
193 193
 }
194 194
 ?>
195 195
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         }
31 31
 
32 32
         $is_active1 = $this->byId("geodirectory-re-captcha")->attribute('class');
33
-        $this->assertFalse( strpos($is_active1, 'inactive'), "ReCaptcha plugin not active");
33
+        $this->assertFalse(strpos($is_active1, 'inactive'), "ReCaptcha plugin not active");
34 34
 
35 35
         //make sure BuddyPress core plugin active
36 36
         $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         }
46 46
 
47 47
         $is_active1 = $this->byId("buddypress")->attribute('class');
48
-        $this->assertFalse( strpos($is_active1, 'inactive'), "buddypress plugin not active");
48
+        $this->assertFalse(strpos($is_active1, 'inactive'), "buddypress plugin not active");
49 49
 
50 50
         //make sure BuddyPress Integration plugin active
51 51
         $is_active = $this->byId("geodirectory-buddypress-integration")->attribute('class');
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         }
58 58
 
59 59
         $is_active1 = $this->byId("geodirectory-buddypress-integration")->attribute('class');
60
-        $this->assertFalse( strpos($is_active1, 'inactive'), "geodirectory buddypress integration plugin not active");
60
+        $this->assertFalse(strpos($is_active1, 'inactive'), "geodirectory buddypress integration plugin not active");
61 61
 
62 62
 
63 63
         $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_recaptcha&subtab=gdcaptcha_settings');
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 
67 67
         $stop_script = false;
68 68
 
69
-        $public_key  = getenv( 'GOOGLE_RECAPTCHA_KEY' );
70
-        $private_key  = getenv( 'GOOGLE_RECAPTCHA_SECRET' );
69
+        $public_key  = getenv('GOOGLE_RECAPTCHA_KEY');
70
+        $private_key = getenv('GOOGLE_RECAPTCHA_SECRET');
71 71
 
72 72
         if (!$public_key) {
73 73
             $this->logError("ENV variable GOOGLE_RECAPTCHA_KEY not available");
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             $stop_script = true;
80 80
         }
81 81
 
82
-        if($stop_script) {
82
+        if ($stop_script) {
83 83
             $this->logInfo("Stopping the script. Please fix the errors to continue");
84 84
             return;
85 85
         }
@@ -124,10 +124,10 @@  discard block
 block discarded – undo
124 124
         //Signup
125 125
         $this->url(self::GDTEST_BASE_URL.'gd-login/?signup=1');
126 126
         $this->waitForPageLoadAndCheckForErrors();
127
-        $this->assertTrue( $this->isTextPresent("Sign Up Now"), "Not in signup page");
127
+        $this->assertTrue($this->isTextPresent("Sign Up Now"), "Not in signup page");
128 128
         $this->waitForPageLoadAndCheckForErrors();
129 129
         $this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
130
-        $this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in signup page");
130
+        $this->assertTrue($this->isTextPresent("I'm not a robot"), "Recaptcha field not found in signup page");
131 131
 
132 132
         //Add Listing
133 133
         $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place');
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
             $this->waitForPageLoadAndCheckForErrors();
142 142
             $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place');
143 143
         }
144
-        $this->assertTrue( $this->isTextPresent("Add Place"), "Not in Add Listing page");
144
+        $this->assertTrue($this->isTextPresent("Add Place"), "Not in Add Listing page");
145 145
         $this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
146
-        $this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in Add Listing page");
146
+        $this->assertTrue($this->isTextPresent("I'm not a robot"), "Recaptcha field not found in Add Listing page");
147 147
 
148 148
         //claim
149 149
         $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/');
@@ -151,14 +151,14 @@  discard block
 block discarded – undo
151 151
         $this->byId('gd-claim-button')->click();
152 152
         $this->waitForPageLoadAndCheckForErrors();
153 153
         $this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
154
-        $this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in claim form");
154
+        $this->assertTrue($this->isTextPresent("I'm not a robot"), "Recaptcha field not found in claim form");
155 155
 
156 156
         //reviews
157 157
         $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/');
158 158
         $this->waitForPageLoadAndCheckForErrors();
159 159
         $this->byLinkText('Reviews')->click();
160 160
         $this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
161
-        $this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in reviews form");
161
+        $this->assertTrue($this->isTextPresent("I'm not a robot"), "Recaptcha field not found in reviews form");
162 162
 
163 163
         //send enquiry
164 164
         $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/');
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $this->byClassName('b_send_inquiry')->click();
167 167
         $this->waitForPageLoadAndCheckForErrors();
168 168
         $this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
169
-        $this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in Send Enquiry form");
169
+        $this->assertTrue($this->isTextPresent("I'm not a robot"), "Recaptcha field not found in Send Enquiry form");
170 170
 
171 171
         //send to friend
172 172
         $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/');
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         $this->byClassName('b_sendtofriend')->click();
175 175
         $this->waitForPageLoadAndCheckForErrors();
176 176
         $this->frame($this->byXPath("//div[@class='gd-captcha-render']//iframe"));
177
-        $this->assertTrue( $this->isTextPresent("I'm not a robot"), "Recaptcha field not found in Send To Friend form");
177
+        $this->assertTrue($this->isTextPresent("I'm not a robot"), "Recaptcha field not found in Send To Friend form");
178 178
 
179 179
         //buddypress
180 180
         //Todo: assert buddypress page
Please login to merge, or discard this patch.
tests/selenium/stest-04_Edit_Listing.php 2 patches
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -1,63 +1,63 @@
 block discarded – undo
1 1
 <?php
2 2
 class EditListing extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7 7
 
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16 16
 
17
-    public function testEditListing()
18
-    {
19
-        $this->logInfo('Editing GD Place listing as user......');
20
-        $this->maybeUserLogin(self::GDTEST_BASE_URL.'author/test-user/?geodir_dashbord=true&stype=gd_place', true);
21
-        $this->assertTrue( $this->isTextPresent("Places by"), "'Places by' text not found");
22
-        $this->byClassName('geodir-edit')->click();
23
-        $this->waitForPageLoadAndCheckForErrors();
24
-        $this->assertTrue( $this->isTextPresent("Edit Place"), "Edit Place text not found");
25
-        $this->byId('post_desc')->value('Test Desc modified');
26
-        $this->byId('geodir_accept_term_condition')->click();
27
-        // Submit the form
28
-        $this->byXPath("//div[@id='geodir-add-listing-submit']//input[@type='submit']")->click();
29
-        $this->waitForPageLoadAndCheckForErrors();
30
-        $this->assertTrue( $this->isTextPresent("This is a preview of your listing"), "Not in preview page.");
31
-        // Submit the form
32
-        $this->byClassName('geodir_publish_button')->click();
33
-        $this->waitForPageLoadAndCheckForErrors();
34
-        $this->assertTrue( $this->isTextPresent("Thank you, your information has been successfully received"), "Not in success page");
35
-        $this->maybeLogout();
36
-    }
17
+	public function testEditListing()
18
+	{
19
+		$this->logInfo('Editing GD Place listing as user......');
20
+		$this->maybeUserLogin(self::GDTEST_BASE_URL.'author/test-user/?geodir_dashbord=true&stype=gd_place', true);
21
+		$this->assertTrue( $this->isTextPresent("Places by"), "'Places by' text not found");
22
+		$this->byClassName('geodir-edit')->click();
23
+		$this->waitForPageLoadAndCheckForErrors();
24
+		$this->assertTrue( $this->isTextPresent("Edit Place"), "Edit Place text not found");
25
+		$this->byId('post_desc')->value('Test Desc modified');
26
+		$this->byId('geodir_accept_term_condition')->click();
27
+		// Submit the form
28
+		$this->byXPath("//div[@id='geodir-add-listing-submit']//input[@type='submit']")->click();
29
+		$this->waitForPageLoadAndCheckForErrors();
30
+		$this->assertTrue( $this->isTextPresent("This is a preview of your listing"), "Not in preview page.");
31
+		// Submit the form
32
+		$this->byClassName('geodir_publish_button')->click();
33
+		$this->waitForPageLoadAndCheckForErrors();
34
+		$this->assertTrue( $this->isTextPresent("Thank you, your information has been successfully received"), "Not in success page");
35
+		$this->maybeLogout();
36
+	}
37 37
 
38
-    public function testEditAdminListing()
39
-    {
40
-        $this->logInfo('Editing GD Place listing as admin......');
41
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/edit.php?post_type=gd_place');
42
-        $this->assertTrue( $this->isTextPresent("post-type-gd_place"), "Not in Places post type");
43
-        $this->byLinkText("Test Listing")->click();
44
-        $this->waitForPageLoadAndCheckForErrors();
45
-        $this->assertTrue( $this->isTextPresent("Edit Place"), "Edit Place text not found");
46
-        $this->byId('title')->value('Test Listing modified');
47
-        // Submit the form
48
-        $this->byId('publish')->click();
49
-        $this->waitForPageLoadAndCheckForErrors();
50
-        $this->assertTrue( $this->isTextPresent("Place updated."), "updated text not found.");
51
-    }
38
+	public function testEditAdminListing()
39
+	{
40
+		$this->logInfo('Editing GD Place listing as admin......');
41
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/edit.php?post_type=gd_place');
42
+		$this->assertTrue( $this->isTextPresent("post-type-gd_place"), "Not in Places post type");
43
+		$this->byLinkText("Test Listing")->click();
44
+		$this->waitForPageLoadAndCheckForErrors();
45
+		$this->assertTrue( $this->isTextPresent("Edit Place"), "Edit Place text not found");
46
+		$this->byId('title')->value('Test Listing modified');
47
+		// Submit the form
48
+		$this->byId('publish')->click();
49
+		$this->waitForPageLoadAndCheckForErrors();
50
+		$this->assertTrue( $this->isTextPresent("Place updated."), "updated text not found.");
51
+	}
52 52
 
53
-    public function tearDown()
54
-    {
55
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
56
-            //write current file number to completed.txt
57
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
58
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
59
-            fwrite($completed, $CurrentFileNumber);
60
-        }
61
-    }
53
+	public function tearDown()
54
+	{
55
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
56
+			//write current file number to completed.txt
57
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
58
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
59
+			fwrite($completed, $CurrentFileNumber);
60
+		}
61
+	}
62 62
 }
63 63
 ?>
64 64
\ 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
@@ -18,20 +18,20 @@  discard block
 block discarded – undo
18 18
     {
19 19
         $this->logInfo('Editing GD Place listing as user......');
20 20
         $this->maybeUserLogin(self::GDTEST_BASE_URL.'author/test-user/?geodir_dashbord=true&stype=gd_place', true);
21
-        $this->assertTrue( $this->isTextPresent("Places by"), "'Places by' text not found");
21
+        $this->assertTrue($this->isTextPresent("Places by"), "'Places by' text not found");
22 22
         $this->byClassName('geodir-edit')->click();
23 23
         $this->waitForPageLoadAndCheckForErrors();
24
-        $this->assertTrue( $this->isTextPresent("Edit Place"), "Edit Place text not found");
24
+        $this->assertTrue($this->isTextPresent("Edit Place"), "Edit Place text not found");
25 25
         $this->byId('post_desc')->value('Test Desc modified');
26 26
         $this->byId('geodir_accept_term_condition')->click();
27 27
         // Submit the form
28 28
         $this->byXPath("//div[@id='geodir-add-listing-submit']//input[@type='submit']")->click();
29 29
         $this->waitForPageLoadAndCheckForErrors();
30
-        $this->assertTrue( $this->isTextPresent("This is a preview of your listing"), "Not in preview page.");
30
+        $this->assertTrue($this->isTextPresent("This is a preview of your listing"), "Not in preview page.");
31 31
         // Submit the form
32 32
         $this->byClassName('geodir_publish_button')->click();
33 33
         $this->waitForPageLoadAndCheckForErrors();
34
-        $this->assertTrue( $this->isTextPresent("Thank you, your information has been successfully received"), "Not in success page");
34
+        $this->assertTrue($this->isTextPresent("Thank you, your information has been successfully received"), "Not in success page");
35 35
         $this->maybeLogout();
36 36
     }
37 37
 
@@ -39,15 +39,15 @@  discard block
 block discarded – undo
39 39
     {
40 40
         $this->logInfo('Editing GD Place listing as admin......');
41 41
         $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/edit.php?post_type=gd_place');
42
-        $this->assertTrue( $this->isTextPresent("post-type-gd_place"), "Not in Places post type");
42
+        $this->assertTrue($this->isTextPresent("post-type-gd_place"), "Not in Places post type");
43 43
         $this->byLinkText("Test Listing")->click();
44 44
         $this->waitForPageLoadAndCheckForErrors();
45
-        $this->assertTrue( $this->isTextPresent("Edit Place"), "Edit Place text not found");
45
+        $this->assertTrue($this->isTextPresent("Edit Place"), "Edit Place text not found");
46 46
         $this->byId('title')->value('Test Listing modified');
47 47
         // Submit the form
48 48
         $this->byId('publish')->click();
49 49
         $this->waitForPageLoadAndCheckForErrors();
50
-        $this->assertTrue( $this->isTextPresent("Place updated."), "updated text not found.");
50
+        $this->assertTrue($this->isTextPresent("Place updated."), "updated text not found.");
51 51
     }
52 52
 
53 53
     public function tearDown()
Please login to merge, or discard this patch.
tests/lib/wordpress-tests-lib/includes/install.php 2 patches
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,9 +44,10 @@
 block discarded – undo
44 44
 	$wpdb->query( "DROP TABLE IF EXISTS $prefixed_table" );
45 45
 
46 46
 	// We need to create references to ms global tables.
47
-	if ( $multisite )
48
-		$wpdb->{$table} = $prefixed_table;
49
-}
47
+	if ( $multisite ) {
48
+			$wpdb->{$table} = $prefixed_table;
49
+	}
50
+	}
50 51
 
51 52
 // Prefill a permalink structure so that WP doesn't try to determine one itself.
52 53
 add_action( 'populate_options', '_set_default_permalink_structure_for_tests' );
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@  discard block
 block discarded – undo
4 4
  *
5 5
  * @todo Reuse the init/load code in init.php
6 6
  */
7
-error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT );
7
+error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
8 8
 
9 9
 $config_file_path = $argv[1];
10
-$multisite = ! empty( $argv[2] );
10
+$multisite = !empty($argv[2]);
11 11
 
12
-define( 'WP_INSTALLING', true );
12
+define('WP_INSTALLING', true);
13 13
 require_once $config_file_path;
14
-require_once dirname( __FILE__ ) . '/functions.php';
14
+require_once dirname(__FILE__).'/functions.php';
15 15
 
16 16
 $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
17 17
 $_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN;
@@ -21,53 +21,53 @@  discard block
 block discarded – undo
21 21
 
22 22
 $PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
23 23
 
24
-require_once ABSPATH . '/wp-settings.php';
24
+require_once ABSPATH.'/wp-settings.php';
25 25
 
26
-require_once ABSPATH . '/wp-admin/includes/upgrade.php';
27
-require_once ABSPATH . '/wp-includes/wp-db.php';
26
+require_once ABSPATH.'/wp-admin/includes/upgrade.php';
27
+require_once ABSPATH.'/wp-includes/wp-db.php';
28 28
 
29 29
 // Override the PHPMailer
30 30
 global $phpmailer;
31
-require_once( dirname( __FILE__ ) . '/mock-mailer.php' );
31
+require_once(dirname(__FILE__).'/mock-mailer.php');
32 32
 $phpmailer = new MockPHPMailer();
33 33
 
34
-$wpdb->query( 'SET storage_engine = INNODB' );
35
-$wpdb->select( DB_NAME, $wpdb->dbh );
34
+$wpdb->query('SET storage_engine = INNODB');
35
+$wpdb->select(DB_NAME, $wpdb->dbh);
36 36
 
37
-echo "Installing..." . PHP_EOL;
37
+echo "Installing...".PHP_EOL;
38 38
 
39
-foreach ( $wpdb->tables() as $table => $prefixed_table ) {
40
-	$wpdb->query( "DROP TABLE IF EXISTS $prefixed_table" );
39
+foreach ($wpdb->tables() as $table => $prefixed_table) {
40
+	$wpdb->query("DROP TABLE IF EXISTS $prefixed_table");
41 41
 }
42 42
 
43
-foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) {
44
-	$wpdb->query( "DROP TABLE IF EXISTS $prefixed_table" );
43
+foreach ($wpdb->tables('ms_global') as $table => $prefixed_table) {
44
+	$wpdb->query("DROP TABLE IF EXISTS $prefixed_table");
45 45
 
46 46
 	// We need to create references to ms global tables.
47
-	if ( $multisite )
47
+	if ($multisite)
48 48
 		$wpdb->{$table} = $prefixed_table;
49 49
 }
50 50
 
51 51
 // Prefill a permalink structure so that WP doesn't try to determine one itself.
52
-add_action( 'populate_options', '_set_default_permalink_structure_for_tests' );
52
+add_action('populate_options', '_set_default_permalink_structure_for_tests');
53 53
 
54
-wp_install( WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, null, 'password' );
54
+wp_install(WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, null, 'password');
55 55
 
56 56
 // Delete dummy permalink structure, as prefilled above.
57
-if ( ! is_multisite() ) {
58
-	delete_option( 'permalink_structure' );
57
+if (!is_multisite()) {
58
+	delete_option('permalink_structure');
59 59
 }
60
-remove_action( 'populate_options', '_set_default_permalink_structure_for_tests' );
60
+remove_action('populate_options', '_set_default_permalink_structure_for_tests');
61 61
 
62
-if ( $multisite ) {
63
-	echo "Installing network..." . PHP_EOL;
62
+if ($multisite) {
63
+	echo "Installing network...".PHP_EOL;
64 64
 
65
-	define( 'WP_INSTALLING_NETWORK', true );
65
+	define('WP_INSTALLING_NETWORK', true);
66 66
 
67
-	$title = WP_TESTS_TITLE . ' Network';
67
+	$title = WP_TESTS_TITLE.' Network';
68 68
 	$subdomain_install = false;
69 69
 
70 70
 	install_network();
71
-	populate_network( 1, WP_TESTS_DOMAIN, WP_TESTS_EMAIL, $title, '/', $subdomain_install );
72
-	$wp_rewrite->set_permalink_structure( '' );
71
+	populate_network(1, WP_TESTS_DOMAIN, WP_TESTS_EMAIL, $title, '/', $subdomain_install);
72
+	$wp_rewrite->set_permalink_structure('');
73 73
 }
Please login to merge, or discard this patch.
geodirectory-admin/option-pages/title_meta_settings_array.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
 $gd_wpseo_use = '';
12 12
 if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
13
-    $gd_wpseo_use = "<b style='color:red;'>".__('Please use the WPSEO settings instead.','geodirectory')."</b><br />";
13
+    $gd_wpseo_use = "<b style='color:red;'>".__('Please use the WPSEO settings instead.', 'geodirectory')."</b><br />";
14 14
 }
15 15
 
16 16
 /**
Please login to merge, or discard this patch.
Indentation   +355 added lines, -355 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 $gd_wpseo_use = '';
12 12
 if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
13
-    $gd_wpseo_use = "<b style='color:red;'>".__('Please use the WPSEO settings instead.','geodirectory')."</b><br />";
13
+	$gd_wpseo_use = "<b style='color:red;'>".__('Please use the WPSEO settings instead.','geodirectory')."</b><br />";
14 14
 }
15 15
 
16 16
 /**
@@ -21,360 +21,360 @@  discard block
 block discarded – undo
21 21
  */
22 22
 $geodir_settings['title_meta_settings'] = apply_filters('geodir_title_meta_settings', array(
23 23
 
24
-    /* Listing Permalink Settings start */
25
-    array('name' => __('Title / Meta', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set page title and meta', 'id' => 'geodir_title_meta_settings '),
26
-
27
-    array('name' => $gd_wpseo_use.__('Available Variables', 'geodirectory'),
28
-        'desc' => '%%title%%, %%sitename%%, %%sitedesc%%, %%excerpt%%, %%pt_single%%, %%pt_plural%%, %%category%%, %%id%%, %%sep%%, %%location%%, %%in_location%%, %%in_location_single%%, %%location_single%%, %%location_country%%, %%in_location_country%%, %%location_region%%, %%in_location_region%%, %%location_city%%, %%in_location_city%%, %%location_sep%%, %%search_term%%, %%search_near%%, %%name%%, %%page%%, %%pagenumber%%, %%pagetotal%%',
29
-        'type' => 'sectionstart',
30
-        'id' => 'geodir_meta_vars'),
31
-
32
-    array('type' => 'sectionend', 'id' => 'geodir_meta_vars'),
33
-
34
-    array('name' => __('Homepage Meta Settings', 'geodirectory'),
35
-        'type' => 'sectionstart',
36
-        'desc' => '',
37
-        'id' => 'geodir_home_meta'),
38
-
39
-    array(
40
-        'name' => __('Homepage meta title', 'geodirectory'),
41
-        'desc' => __('This will use the title of the page set as frontpage if left blank.', 'geodirectory'),
42
-        'id' => 'geodir_meta_title_homepage',
43
-        'type' => 'text',
44
-        'css' => 'width:100%;',
45
-        'std' => '',
46
-        'placeholder' => ''
47
-    ),
48
-
49
-    array(
50
-        'name' => __('Homepage meta description', 'geodirectory'),
51
-        'desc' => __('Enter the meta description for the homepage.', 'geodirectory'),
52
-        'id' => 'geodir_meta_desc_homepage',
53
-        'type' => 'textarea',
54
-        'css' => 'width:100%;',
55
-        'std' => ''
56
-    ),
57
-
58
-    array('type' => 'sectionend', 'id' => 'geodir_home_meta'),
59
-
60
-    // details page meta
61
-    array('name' => __('Details Page Meta Settings', 'geodirectory'),
62
-        'type' => 'sectionstart',
63
-        'desc' => '',
64
-        'id' => 'geodir_details_meta'),
65
-
66
-    array(
67
-        'name' => __('Details page meta title', 'geodirectory'),
68
-        'desc' => __('Enter the meta title for the details page.', 'geodirectory'),
69
-        'id' => 'geodir_meta_title_detail',
70
-        'type' => 'text',
71
-        'css' => 'width:100%;',
72
-        'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'),
73
-        'placeholder' => '%%title%% %%sep%% %%sitename%%'
74
-    ),
75
-
76
-    array(
77
-        'name' => __('Details page meta description', 'geodirectory'),
78
-        'desc' => __('Enter the meta description for the details page.', 'geodirectory'),
79
-        'id' => 'geodir_meta_desc_detail',
80
-        'type' => 'textarea',
81
-        'css' => 'width:100%;',
82
-        'std' => __('%%excerpt%%', 'geodirectory'),
83
-        'placeholder' => '%%excerpt%%'
84
-    ),
85
-
86
-    array('type' => 'sectionend', 'id' => 'geodir_details_meta'),
87
-
88
-    // CPT page meta
89
-    array('name' => __('Post Type Page Meta Settings', 'geodirectory'),
90
-        'type' => 'sectionstart',
91
-        'desc' => '',
92
-        'id' => 'geodir_pt_meta'),
93
-
94
-    array(
95
-        'name' => __('Post type page meta title', 'geodirectory'),
96
-        'desc' => __('Enter the meta title for the post type pages.', 'geodirectory'),
97
-        'id' => 'geodir_meta_title_pt',
98
-        'type' => 'text',
99
-        'css' => 'width:100%;',
100
-        'std' => __('%%pt_plural%% %%in_location%% %%sep%% %%sitename%%', 'geodirectory'),
101
-        'placeholder' => '%%pt_plural%% %%in_location%% %%sep%% %%sitename%%'
102
-    ),
103
-
104
-    array(
105
-        'name' => __('Post type page meta description', 'geodirectory'),
106
-        'desc' => __('Enter the meta description for the post type pages.', 'geodirectory'),
107
-        'id' => 'geodir_meta_desc_pt',
108
-        'type' => 'textarea',
109
-        'css' => 'width:100%;',
110
-        'std' => __('%%pt_plural%% %%in_location%%', 'geodirectory'),
111
-        'placeholder' => '%%pt_plural%% %%in_location%%'
112
-    ),
113
-
114
-    array(
115
-        'name' => __('Post type page title', 'geodirectory'),
116
-        'desc' => __('Enter the title for the post type pages.', 'geodirectory'),
117
-        'id' => 'geodir_page_title_pt',
118
-        'type' => 'text',
119
-        'css' => 'width:100%;',
120
-        'std' => __('All %%pt_plural%% %%in_location_single%%', 'geodirectory'),
121
-        'placeholder' => 'All %%pt_plural%% %%in_location_single%%'
122
-    ),
123
-
124
-    array('type' => 'sectionend', 'id' => 'geodir_pt_meta'),
125
-
126
-    // Cat listing page meta
127
-    array('name' => __('Listing Page Meta Settings', 'geodirectory'),
128
-        'type' => 'sectionstart',
129
-        'desc' => '',
130
-        'id' => 'geodir_pt_meta'),
131
-
132
-    array(
133
-        'name' => __('Listing page meta title', 'geodirectory'),
134
-        'desc' => __('Enter the meta title for the category listing pages.', 'geodirectory'),
135
-        'id' => 'geodir_meta_title_listing',
136
-        'type' => 'text',
137
-        'css' => 'width:100%;',
138
-        'std' => __('%%category%% %%in_location%% %%sep%% %%sitename%%', 'geodirectory'),
139
-        'placeholder' => '%%category%% %%in_location%% %%sep%% %%sitename%%'
140
-    ),
141
-
142
-    array(
143
-        'name' => __('Listing page meta description', 'geodirectory'),
144
-        'desc' => __('Enter the meta description for the category listing pages.', 'geodirectory'),
145
-        'id' => 'geodir_meta_desc_listing',
146
-        'type' => 'textarea',
147
-        'css' => 'width:100%;',
148
-        'std' => __('Posts related to Category: %%category%% %%in_location%%', 'geodirectory'),
149
-        'placeholder' => 'Posts related to Category: %%category%% %%in_location%%'
150
-    ),
151
-
152
-    array(
153
-        'name' => __('Category listing page title', 'geodirectory'),
154
-        'desc' => __('Enter the title for the category listing pages.', 'geodirectory'),
155
-        'id' => 'geodir_page_title_cat-listing',
156
-        'type' => 'text',
157
-        'css' => 'width:100%;',
158
-        'std' => __('All %%category%% %%in_location_single%%', 'geodirectory'),
159
-        'placeholder' => 'All %%category%% %%in_location_single%%'
160
-    ),
161
-
162
-    array(
163
-        'name' => __('Tag listing page title', 'geodirectory'),
164
-        'desc' => __('Enter the title for the tag listing pages.', 'geodirectory'),
165
-        'id' => 'geodir_page_title_tag-listing',
166
-        'type' => 'text',
167
-        'css' => 'width:100%;',
168
-        'std' => __('Tag: %%tag%% %%in_location_single%%', 'geodirectory'),
169
-        'placeholder' => 'Tag: %%tag%% %%in_location_single%%'
170
-    ),
171
-
172
-    array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
173
-
174
-    // location page meta
175
-    array('name' => __('Location Page Meta Settings', 'geodirectory'),
176
-        'type' => 'sectionstart',
177
-        'desc' => '',
178
-        'id' => 'geodir_pt_meta'),
179
-
180
-    array(
181
-        'name' => __('Location page meta title', 'geodirectory'),
182
-        'desc' => __('Enter the meta title for the location pages.', 'geodirectory'),
183
-        'id' => 'geodir_meta_title_location',
184
-        'type' => 'text',
185
-        'css' => 'width:100%;',
186
-        'std' => __('%%title%% %%location%% %%sep%% %%sitename%%', 'geodirectory'),
187
-        'placeholder' => '%%title%% %%location%% %%sep%% %%sitename%%'
188
-    ),
189
-
190
-    array(
191
-        'name' => __('Location page meta description', 'geodirectory'),
192
-        'desc' => __('Enter the meta description for the location pages.', 'geodirectory'),
193
-        'id' => 'geodir_meta_desc_location',
194
-        'type' => 'textarea',
195
-        'css' => 'width:100%;',
196
-        'std' => __('%%location%%', 'geodirectory'),
197
-        'placeholder' => '%%location%%'
198
-    ),
199
-
200
-    array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
201
-
202
-    // Search page meta
203
-    array('name' => __('Search Page Meta Settings', 'geodirectory'),
204
-        'type' => 'sectionstart',
205
-        'desc' => '',
206
-        'id' => 'geodir_pt_meta'),
207
-
208
-    array(
209
-        'name' => __('Search page meta title', 'geodirectory'),
210
-        'desc' => __('Enter the meta title for the search page.', 'geodirectory'),
211
-        'id' => 'geodir_meta_title_search',
212
-        'type' => 'text',
213
-        'css' => 'width:100%;',
214
-        'std' => __('%%pt_plural%% search results for %%search_term%%, Near %%search_near%% %%sep%% %%sitename%%', 'geodirectory'),
215
-        'placeholder' => '%%pt_plural%% search results for %%search_term%%, Near %%search_near%% %%sep%% %%sitename%%'
216
-    ),
217
-
218
-    array(
219
-        'name' => __('Search page meta description', 'geodirectory'),
220
-        'desc' => __('Enter the meta description for the search page.', 'geodirectory'),
221
-        'id' => 'geodir_meta_desc_search',
222
-        'type' => 'textarea',
223
-        'css' => 'width:100%;',
224
-        'std' => __('%%pt_plural%% search results for %%search_term%%, Near %%search_near%%', 'geodirectory'),
225
-        'placeholder' => '%%pt_plural%% search results for %%search_term%%, Near %%search_near%%'
226
-    ),
227
-
228
-    array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
229
-
230
-    //Add listing page meta
231
-    array('name' => __('Add Listing Page Meta Settings', 'geodirectory'),
232
-        'type' => 'sectionstart',
233
-        'desc' => '',
234
-        'id' => 'geodir_pt_meta'),
235
-
236
-    array(
237
-        'name' => __('Add listing page meta title', 'geodirectory'),
238
-        'desc' => __('Enter the meta title for the add listing page.', 'geodirectory'),
239
-        'id' => 'geodir_meta_title_add-listing',
240
-        'type' => 'text',
241
-        'css' => 'width:100%;',
242
-        'std' => __('Add %%pt_single%% %%sep%% %%sitename%%', 'geodirectory'),
243
-        'placeholder' => 'Add %%pt_single%% %%sep%% %%sitename%%'
244
-    ),
245
-
246
-    array(
247
-        'name' => __('Add listing page meta description', 'geodirectory'),
248
-        'desc' => __('Enter the meta description for the add listing page.', 'geodirectory'),
249
-        'id' => 'geodir_meta_desc_add-listing',
250
-        'type' => 'textarea',
251
-        'css' => 'width:100%;',
252
-        'std' => __('Add %%pt_single%%', 'geodirectory'),
253
-        'placeholder' => 'Add %%pt_single%%'
254
-    ),
255
-
256
-    array(
257
-        'name' => __('Add listing page title', 'geodirectory'),
258
-        'desc' => __('Enter the title for the add listing page.', 'geodirectory'),
259
-        'id' => 'geodir_page_title_add-listing',
260
-        'type' => 'text',
261
-        'css' => 'width:100%;',
262
-        'std' => __('Add %%pt_single%%', 'geodirectory'),
263
-        'placeholder' => 'Add %%pt_single%%'
264
-    ),
265
-
266
-    array(
267
-        'name' => __('Edit listing page title', 'geodirectory'),
268
-        'desc' => __('Enter the title for the edit listing page.', 'geodirectory'),
269
-        'id' => 'geodir_page_title_edit-listing',
270
-        'type' => 'text',
271
-        'css' => 'width:100%;',
272
-        'std' => __('Edit %%pt_single%%', 'geodirectory'),
273
-        'placeholder' => 'Edit %%pt_single%%'
274
-    ),
275
-
276
-    array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
277
-
278
-    //Author page meta
279
-    array('name' => __('Author Page Meta Settings', 'geodirectory'),
280
-        'type' => 'sectionstart',
281
-        'desc' => '',
282
-        'id' => 'geodir_pt_meta'),
283
-
284
-    array(
285
-        'name' => __('Author page meta title', 'geodirectory'),
286
-        'desc' => __('Enter the meta title for the author page.', 'geodirectory'),
287
-        'id' => 'geodir_meta_title_author',
288
-        'type' => 'text',
289
-        'css' => 'width:100%;',
290
-        'std' => __('Author: %%name%% %%sep%% %%sitename%%', 'geodirectory'),
291
-        'placeholder' => 'Author: %%name%% %%sep%% %%sitename%%'
292
-    ),
293
-
294
-    array(
295
-        'name' => __('Author page meta description', 'geodirectory'),
296
-        'desc' => __('Enter the meta description for the author page.', 'geodirectory'),
297
-        'id' => 'geodir_meta_desc_author',
298
-        'type' => 'textarea',
299
-        'css' => 'width:100%;',
300
-        'std' => ''
301
-    ),
302
-
303
-    array(
304
-        'name' => __('Author page title', 'geodirectory'),
305
-        'desc' => __('Enter the title for the author page.', 'geodirectory'),
306
-        'id' => 'geodir_page_title_author',
307
-        'type' => 'text',
308
-        'css' => 'width:100%;',
309
-        'std' => __('%%pt_plural%% by: %%name%%', 'geodirectory'),
310
-        'placeholder' => '%%pt_plural%% by: %%name%%'
311
-    ),
312
-
313
-    array(
314
-        'name' => __('Author favorite page title', 'geodirectory'),
315
-        'desc' => __('Enter the title for the author favorite page.', 'geodirectory'),
316
-        'id' => 'geodir_page_title_favorite',
317
-        'type' => 'text',
318
-        'css' => 'width:100%;',
319
-        'std' => __('%%name%%: Favorite %%pt_plural%%', 'geodirectory'),
320
-        'placeholder' => '%%name%%: Favorite %%pt_plural%%'
321
-    ),
322
-
323
-    array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
324
-
325
-    //Login page meta
326
-    array('name' => __('Login Page Meta Settings', 'geodirectory'),
327
-        'type' => 'sectionstart',
328
-        'desc' => '',
329
-        'id' => 'geodir_login_meta'),
330
-
331
-    array(
332
-        'name' => __('Login page meta title', 'geodirectory'),
333
-        'desc' => __('Enter the meta title for the login page.', 'geodirectory'),
334
-        'id' => 'geodir_meta_title_login',
335
-        'type' => 'text',
336
-        'css' => 'width:100%;',
337
-        'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'),
338
-        'placeholder' => '%%title%% %%sep%% %%sitename%%'
339
-    ),
340
-
341
-    array(
342
-        'name' => __('Login page meta description', 'geodirectory'),
343
-        'desc' => __('Enter the meta description for the login page.', 'geodirectory'),
344
-        'id' => 'geodir_meta_desc_login',
345
-        'type' => 'textarea',
346
-        'css' => 'width:100%;',
347
-        'std' => ''
348
-    ),
349
-
350
-    array('type' => 'sectionend', 'id' => 'geodir_login_meta'),
351
-
352
-    //Listing success page meta
353
-    array('name' => __('Listing Success Page Meta Settings', 'geodirectory'),
354
-        'type' => 'sectionstart',
355
-        'desc' => '',
356
-        'id' => 'geodir_login_meta'),
357
-
358
-    array(
359
-        'name' => __('Listing success page meta title', 'geodirectory'),
360
-        'desc' => __('Enter the meta title for the listing success page.', 'geodirectory'),
361
-        'id' => 'geodir_meta_title_listing-success',
362
-        'type' => 'text',
363
-        'css' => 'width:100%;',
364
-        'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'),
365
-        'placeholder' => '%%title%% %%sep%% %%sitename%%'
366
-    ),
367
-
368
-    array(
369
-        'name' => __('Listing success page meta description', 'geodirectory'),
370
-        'desc' => __('Enter the meta description for the listing success page.', 'geodirectory'),
371
-        'id' => 'geodir_meta_desc_listing-success',
372
-        'type' => 'textarea',
373
-        'css' => 'width:100%;',
374
-        'std' => ''
375
-    ),
376
-
377
-    array('type' => 'sectionend', 'id' => 'geodir_login_meta'),
24
+	/* Listing Permalink Settings start */
25
+	array('name' => __('Title / Meta', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set page title and meta', 'id' => 'geodir_title_meta_settings '),
26
+
27
+	array('name' => $gd_wpseo_use.__('Available Variables', 'geodirectory'),
28
+		'desc' => '%%title%%, %%sitename%%, %%sitedesc%%, %%excerpt%%, %%pt_single%%, %%pt_plural%%, %%category%%, %%id%%, %%sep%%, %%location%%, %%in_location%%, %%in_location_single%%, %%location_single%%, %%location_country%%, %%in_location_country%%, %%location_region%%, %%in_location_region%%, %%location_city%%, %%in_location_city%%, %%location_sep%%, %%search_term%%, %%search_near%%, %%name%%, %%page%%, %%pagenumber%%, %%pagetotal%%',
29
+		'type' => 'sectionstart',
30
+		'id' => 'geodir_meta_vars'),
31
+
32
+	array('type' => 'sectionend', 'id' => 'geodir_meta_vars'),
33
+
34
+	array('name' => __('Homepage Meta Settings', 'geodirectory'),
35
+		'type' => 'sectionstart',
36
+		'desc' => '',
37
+		'id' => 'geodir_home_meta'),
38
+
39
+	array(
40
+		'name' => __('Homepage meta title', 'geodirectory'),
41
+		'desc' => __('This will use the title of the page set as frontpage if left blank.', 'geodirectory'),
42
+		'id' => 'geodir_meta_title_homepage',
43
+		'type' => 'text',
44
+		'css' => 'width:100%;',
45
+		'std' => '',
46
+		'placeholder' => ''
47
+	),
48
+
49
+	array(
50
+		'name' => __('Homepage meta description', 'geodirectory'),
51
+		'desc' => __('Enter the meta description for the homepage.', 'geodirectory'),
52
+		'id' => 'geodir_meta_desc_homepage',
53
+		'type' => 'textarea',
54
+		'css' => 'width:100%;',
55
+		'std' => ''
56
+	),
57
+
58
+	array('type' => 'sectionend', 'id' => 'geodir_home_meta'),
59
+
60
+	// details page meta
61
+	array('name' => __('Details Page Meta Settings', 'geodirectory'),
62
+		'type' => 'sectionstart',
63
+		'desc' => '',
64
+		'id' => 'geodir_details_meta'),
65
+
66
+	array(
67
+		'name' => __('Details page meta title', 'geodirectory'),
68
+		'desc' => __('Enter the meta title for the details page.', 'geodirectory'),
69
+		'id' => 'geodir_meta_title_detail',
70
+		'type' => 'text',
71
+		'css' => 'width:100%;',
72
+		'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'),
73
+		'placeholder' => '%%title%% %%sep%% %%sitename%%'
74
+	),
75
+
76
+	array(
77
+		'name' => __('Details page meta description', 'geodirectory'),
78
+		'desc' => __('Enter the meta description for the details page.', 'geodirectory'),
79
+		'id' => 'geodir_meta_desc_detail',
80
+		'type' => 'textarea',
81
+		'css' => 'width:100%;',
82
+		'std' => __('%%excerpt%%', 'geodirectory'),
83
+		'placeholder' => '%%excerpt%%'
84
+	),
85
+
86
+	array('type' => 'sectionend', 'id' => 'geodir_details_meta'),
87
+
88
+	// CPT page meta
89
+	array('name' => __('Post Type Page Meta Settings', 'geodirectory'),
90
+		'type' => 'sectionstart',
91
+		'desc' => '',
92
+		'id' => 'geodir_pt_meta'),
93
+
94
+	array(
95
+		'name' => __('Post type page meta title', 'geodirectory'),
96
+		'desc' => __('Enter the meta title for the post type pages.', 'geodirectory'),
97
+		'id' => 'geodir_meta_title_pt',
98
+		'type' => 'text',
99
+		'css' => 'width:100%;',
100
+		'std' => __('%%pt_plural%% %%in_location%% %%sep%% %%sitename%%', 'geodirectory'),
101
+		'placeholder' => '%%pt_plural%% %%in_location%% %%sep%% %%sitename%%'
102
+	),
103
+
104
+	array(
105
+		'name' => __('Post type page meta description', 'geodirectory'),
106
+		'desc' => __('Enter the meta description for the post type pages.', 'geodirectory'),
107
+		'id' => 'geodir_meta_desc_pt',
108
+		'type' => 'textarea',
109
+		'css' => 'width:100%;',
110
+		'std' => __('%%pt_plural%% %%in_location%%', 'geodirectory'),
111
+		'placeholder' => '%%pt_plural%% %%in_location%%'
112
+	),
113
+
114
+	array(
115
+		'name' => __('Post type page title', 'geodirectory'),
116
+		'desc' => __('Enter the title for the post type pages.', 'geodirectory'),
117
+		'id' => 'geodir_page_title_pt',
118
+		'type' => 'text',
119
+		'css' => 'width:100%;',
120
+		'std' => __('All %%pt_plural%% %%in_location_single%%', 'geodirectory'),
121
+		'placeholder' => 'All %%pt_plural%% %%in_location_single%%'
122
+	),
123
+
124
+	array('type' => 'sectionend', 'id' => 'geodir_pt_meta'),
125
+
126
+	// Cat listing page meta
127
+	array('name' => __('Listing Page Meta Settings', 'geodirectory'),
128
+		'type' => 'sectionstart',
129
+		'desc' => '',
130
+		'id' => 'geodir_pt_meta'),
131
+
132
+	array(
133
+		'name' => __('Listing page meta title', 'geodirectory'),
134
+		'desc' => __('Enter the meta title for the category listing pages.', 'geodirectory'),
135
+		'id' => 'geodir_meta_title_listing',
136
+		'type' => 'text',
137
+		'css' => 'width:100%;',
138
+		'std' => __('%%category%% %%in_location%% %%sep%% %%sitename%%', 'geodirectory'),
139
+		'placeholder' => '%%category%% %%in_location%% %%sep%% %%sitename%%'
140
+	),
141
+
142
+	array(
143
+		'name' => __('Listing page meta description', 'geodirectory'),
144
+		'desc' => __('Enter the meta description for the category listing pages.', 'geodirectory'),
145
+		'id' => 'geodir_meta_desc_listing',
146
+		'type' => 'textarea',
147
+		'css' => 'width:100%;',
148
+		'std' => __('Posts related to Category: %%category%% %%in_location%%', 'geodirectory'),
149
+		'placeholder' => 'Posts related to Category: %%category%% %%in_location%%'
150
+	),
151
+
152
+	array(
153
+		'name' => __('Category listing page title', 'geodirectory'),
154
+		'desc' => __('Enter the title for the category listing pages.', 'geodirectory'),
155
+		'id' => 'geodir_page_title_cat-listing',
156
+		'type' => 'text',
157
+		'css' => 'width:100%;',
158
+		'std' => __('All %%category%% %%in_location_single%%', 'geodirectory'),
159
+		'placeholder' => 'All %%category%% %%in_location_single%%'
160
+	),
161
+
162
+	array(
163
+		'name' => __('Tag listing page title', 'geodirectory'),
164
+		'desc' => __('Enter the title for the tag listing pages.', 'geodirectory'),
165
+		'id' => 'geodir_page_title_tag-listing',
166
+		'type' => 'text',
167
+		'css' => 'width:100%;',
168
+		'std' => __('Tag: %%tag%% %%in_location_single%%', 'geodirectory'),
169
+		'placeholder' => 'Tag: %%tag%% %%in_location_single%%'
170
+	),
171
+
172
+	array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
173
+
174
+	// location page meta
175
+	array('name' => __('Location Page Meta Settings', 'geodirectory'),
176
+		'type' => 'sectionstart',
177
+		'desc' => '',
178
+		'id' => 'geodir_pt_meta'),
179
+
180
+	array(
181
+		'name' => __('Location page meta title', 'geodirectory'),
182
+		'desc' => __('Enter the meta title for the location pages.', 'geodirectory'),
183
+		'id' => 'geodir_meta_title_location',
184
+		'type' => 'text',
185
+		'css' => 'width:100%;',
186
+		'std' => __('%%title%% %%location%% %%sep%% %%sitename%%', 'geodirectory'),
187
+		'placeholder' => '%%title%% %%location%% %%sep%% %%sitename%%'
188
+	),
189
+
190
+	array(
191
+		'name' => __('Location page meta description', 'geodirectory'),
192
+		'desc' => __('Enter the meta description for the location pages.', 'geodirectory'),
193
+		'id' => 'geodir_meta_desc_location',
194
+		'type' => 'textarea',
195
+		'css' => 'width:100%;',
196
+		'std' => __('%%location%%', 'geodirectory'),
197
+		'placeholder' => '%%location%%'
198
+	),
199
+
200
+	array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
201
+
202
+	// Search page meta
203
+	array('name' => __('Search Page Meta Settings', 'geodirectory'),
204
+		'type' => 'sectionstart',
205
+		'desc' => '',
206
+		'id' => 'geodir_pt_meta'),
207
+
208
+	array(
209
+		'name' => __('Search page meta title', 'geodirectory'),
210
+		'desc' => __('Enter the meta title for the search page.', 'geodirectory'),
211
+		'id' => 'geodir_meta_title_search',
212
+		'type' => 'text',
213
+		'css' => 'width:100%;',
214
+		'std' => __('%%pt_plural%% search results for %%search_term%%, Near %%search_near%% %%sep%% %%sitename%%', 'geodirectory'),
215
+		'placeholder' => '%%pt_plural%% search results for %%search_term%%, Near %%search_near%% %%sep%% %%sitename%%'
216
+	),
217
+
218
+	array(
219
+		'name' => __('Search page meta description', 'geodirectory'),
220
+		'desc' => __('Enter the meta description for the search page.', 'geodirectory'),
221
+		'id' => 'geodir_meta_desc_search',
222
+		'type' => 'textarea',
223
+		'css' => 'width:100%;',
224
+		'std' => __('%%pt_plural%% search results for %%search_term%%, Near %%search_near%%', 'geodirectory'),
225
+		'placeholder' => '%%pt_plural%% search results for %%search_term%%, Near %%search_near%%'
226
+	),
227
+
228
+	array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
229
+
230
+	//Add listing page meta
231
+	array('name' => __('Add Listing Page Meta Settings', 'geodirectory'),
232
+		'type' => 'sectionstart',
233
+		'desc' => '',
234
+		'id' => 'geodir_pt_meta'),
235
+
236
+	array(
237
+		'name' => __('Add listing page meta title', 'geodirectory'),
238
+		'desc' => __('Enter the meta title for the add listing page.', 'geodirectory'),
239
+		'id' => 'geodir_meta_title_add-listing',
240
+		'type' => 'text',
241
+		'css' => 'width:100%;',
242
+		'std' => __('Add %%pt_single%% %%sep%% %%sitename%%', 'geodirectory'),
243
+		'placeholder' => 'Add %%pt_single%% %%sep%% %%sitename%%'
244
+	),
245
+
246
+	array(
247
+		'name' => __('Add listing page meta description', 'geodirectory'),
248
+		'desc' => __('Enter the meta description for the add listing page.', 'geodirectory'),
249
+		'id' => 'geodir_meta_desc_add-listing',
250
+		'type' => 'textarea',
251
+		'css' => 'width:100%;',
252
+		'std' => __('Add %%pt_single%%', 'geodirectory'),
253
+		'placeholder' => 'Add %%pt_single%%'
254
+	),
255
+
256
+	array(
257
+		'name' => __('Add listing page title', 'geodirectory'),
258
+		'desc' => __('Enter the title for the add listing page.', 'geodirectory'),
259
+		'id' => 'geodir_page_title_add-listing',
260
+		'type' => 'text',
261
+		'css' => 'width:100%;',
262
+		'std' => __('Add %%pt_single%%', 'geodirectory'),
263
+		'placeholder' => 'Add %%pt_single%%'
264
+	),
265
+
266
+	array(
267
+		'name' => __('Edit listing page title', 'geodirectory'),
268
+		'desc' => __('Enter the title for the edit listing page.', 'geodirectory'),
269
+		'id' => 'geodir_page_title_edit-listing',
270
+		'type' => 'text',
271
+		'css' => 'width:100%;',
272
+		'std' => __('Edit %%pt_single%%', 'geodirectory'),
273
+		'placeholder' => 'Edit %%pt_single%%'
274
+	),
275
+
276
+	array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
277
+
278
+	//Author page meta
279
+	array('name' => __('Author Page Meta Settings', 'geodirectory'),
280
+		'type' => 'sectionstart',
281
+		'desc' => '',
282
+		'id' => 'geodir_pt_meta'),
283
+
284
+	array(
285
+		'name' => __('Author page meta title', 'geodirectory'),
286
+		'desc' => __('Enter the meta title for the author page.', 'geodirectory'),
287
+		'id' => 'geodir_meta_title_author',
288
+		'type' => 'text',
289
+		'css' => 'width:100%;',
290
+		'std' => __('Author: %%name%% %%sep%% %%sitename%%', 'geodirectory'),
291
+		'placeholder' => 'Author: %%name%% %%sep%% %%sitename%%'
292
+	),
293
+
294
+	array(
295
+		'name' => __('Author page meta description', 'geodirectory'),
296
+		'desc' => __('Enter the meta description for the author page.', 'geodirectory'),
297
+		'id' => 'geodir_meta_desc_author',
298
+		'type' => 'textarea',
299
+		'css' => 'width:100%;',
300
+		'std' => ''
301
+	),
302
+
303
+	array(
304
+		'name' => __('Author page title', 'geodirectory'),
305
+		'desc' => __('Enter the title for the author page.', 'geodirectory'),
306
+		'id' => 'geodir_page_title_author',
307
+		'type' => 'text',
308
+		'css' => 'width:100%;',
309
+		'std' => __('%%pt_plural%% by: %%name%%', 'geodirectory'),
310
+		'placeholder' => '%%pt_plural%% by: %%name%%'
311
+	),
312
+
313
+	array(
314
+		'name' => __('Author favorite page title', 'geodirectory'),
315
+		'desc' => __('Enter the title for the author favorite page.', 'geodirectory'),
316
+		'id' => 'geodir_page_title_favorite',
317
+		'type' => 'text',
318
+		'css' => 'width:100%;',
319
+		'std' => __('%%name%%: Favorite %%pt_plural%%', 'geodirectory'),
320
+		'placeholder' => '%%name%%: Favorite %%pt_plural%%'
321
+	),
322
+
323
+	array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
324
+
325
+	//Login page meta
326
+	array('name' => __('Login Page Meta Settings', 'geodirectory'),
327
+		'type' => 'sectionstart',
328
+		'desc' => '',
329
+		'id' => 'geodir_login_meta'),
330
+
331
+	array(
332
+		'name' => __('Login page meta title', 'geodirectory'),
333
+		'desc' => __('Enter the meta title for the login page.', 'geodirectory'),
334
+		'id' => 'geodir_meta_title_login',
335
+		'type' => 'text',
336
+		'css' => 'width:100%;',
337
+		'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'),
338
+		'placeholder' => '%%title%% %%sep%% %%sitename%%'
339
+	),
340
+
341
+	array(
342
+		'name' => __('Login page meta description', 'geodirectory'),
343
+		'desc' => __('Enter the meta description for the login page.', 'geodirectory'),
344
+		'id' => 'geodir_meta_desc_login',
345
+		'type' => 'textarea',
346
+		'css' => 'width:100%;',
347
+		'std' => ''
348
+	),
349
+
350
+	array('type' => 'sectionend', 'id' => 'geodir_login_meta'),
351
+
352
+	//Listing success page meta
353
+	array('name' => __('Listing Success Page Meta Settings', 'geodirectory'),
354
+		'type' => 'sectionstart',
355
+		'desc' => '',
356
+		'id' => 'geodir_login_meta'),
357
+
358
+	array(
359
+		'name' => __('Listing success page meta title', 'geodirectory'),
360
+		'desc' => __('Enter the meta title for the listing success page.', 'geodirectory'),
361
+		'id' => 'geodir_meta_title_listing-success',
362
+		'type' => 'text',
363
+		'css' => 'width:100%;',
364
+		'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'),
365
+		'placeholder' => '%%title%% %%sep%% %%sitename%%'
366
+	),
367
+
368
+	array(
369
+		'name' => __('Listing success page meta description', 'geodirectory'),
370
+		'desc' => __('Enter the meta description for the listing success page.', 'geodirectory'),
371
+		'id' => 'geodir_meta_desc_listing-success',
372
+		'type' => 'textarea',
373
+		'css' => 'width:100%;',
374
+		'std' => ''
375
+	),
376
+
377
+	array('type' => 'sectionend', 'id' => 'geodir_login_meta'),
378 378
 
379 379
 
380 380
 
Please login to merge, or discard this patch.