@@ -1,101 +1,101 @@ |
||
1 | 1 | <?php |
2 | 2 | class GDAjaxTests extends WP_Ajax_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - } |
|
9 | - |
|
10 | - public function testBestOfWidgetAjax() { |
|
11 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
12 | - include_once($template); |
|
13 | - |
|
14 | - $time = current_time('mysql'); |
|
15 | - |
|
16 | - $query_args = array( |
|
17 | - 'post_status' => 'publish', |
|
18 | - 'post_type' => 'gd_place', |
|
19 | - 'posts_per_page' => 1, |
|
20 | - ); |
|
21 | - |
|
22 | - $all_posts = new WP_Query( $query_args ); |
|
23 | - $post_id = null; |
|
24 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
25 | - $post_id = get_the_ID(); |
|
26 | - endwhile; |
|
27 | - |
|
28 | - $this->assertTrue(is_int($post_id)); |
|
29 | - |
|
30 | - $data = array( |
|
31 | - 'comment_post_ID' => $post_id, |
|
32 | - 'comment_author' => 'admin', |
|
33 | - 'comment_author_email' => '[email protected]', |
|
34 | - 'comment_author_url' => 'http://wpgeodirectory.com', |
|
35 | - 'comment_content' => 'content here', |
|
36 | - 'comment_type' => '', |
|
37 | - 'comment_parent' => 0, |
|
38 | - 'user_id' => 1, |
|
39 | - 'comment_author_IP' => '127.0.0.1', |
|
40 | - 'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)', |
|
41 | - 'comment_date' => $time, |
|
42 | - 'comment_approved' => 1, |
|
43 | - ); |
|
44 | - |
|
45 | - $comment_id = wp_insert_comment($data); |
|
46 | - |
|
47 | - $_REQUEST['geodir_overallrating'] = 5.0; |
|
48 | - geodir_save_rating($comment_id); |
|
49 | - |
|
50 | - $this->assertTrue(is_int($comment_id)); |
|
51 | - |
|
52 | - //ajax function test |
|
53 | - $ajax_nonce = wp_create_nonce("geodir-bestof-nonce"); |
|
54 | - |
|
55 | - $terms = get_terms( array( |
|
56 | - 'taxonomy' => 'gd_placecategory', |
|
57 | - 'hide_empty' => false, |
|
58 | - ) ); |
|
59 | - $term_id = $terms[0]->term_id; |
|
60 | - |
|
61 | - $_POST['post_type'] = 'gd_place'; |
|
62 | - $_POST['post_limit'] = '5'; |
|
63 | - $_POST['char_count'] = '20'; |
|
64 | - $_POST['taxonomy'] = 'gd_placecategory'; |
|
65 | - $_POST['add_location_filter'] = '1'; |
|
66 | - $_POST['term_id'] = (string) $term_id; |
|
67 | - $_POST['excerpt_type'] = 'show-reviews'; |
|
68 | - $_POST['geodir_bestof_nonce'] = $ajax_nonce; |
|
69 | - |
|
70 | - $this->_handleAjax('geodir_bestof'); |
|
71 | - $this->assertContains("bestof-cat-title", $this->_last_response); |
|
72 | - |
|
73 | - |
|
74 | - } |
|
75 | - |
|
76 | - public function texstImportExport() { |
|
77 | - $nonce = wp_create_nonce( 'geodir_import_export_nonce' ); |
|
78 | - |
|
79 | - $_POST['_nonce'] = $nonce; |
|
80 | - $_POST['_pt'] = 'gd_place'; |
|
81 | - $_POST['task'] = 'export_posts'; |
|
82 | - $_POST['_n'] = 5000; |
|
83 | - $_POST['_p'] = 1; |
|
84 | - |
|
85 | - $this->_handleAjax('geodir_import_export'); |
|
86 | - try { |
|
87 | - $this->assertContains("bestof-cat-title", $this->_last_response); |
|
88 | - } catch (WPAjaxDieStopException $e) { |
|
89 | - var_dump("WPAjaxDieStopException: " . $e ); |
|
90 | - } catch (WPAjaxDieContinueException $e) { |
|
91 | - var_dump("WPAjaxDieContinueException: " . $e ); |
|
92 | - } |
|
93 | - |
|
94 | - } |
|
95 | - |
|
96 | - public function tearDown() |
|
97 | - { |
|
98 | - parent::tearDown(); |
|
99 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + } |
|
9 | + |
|
10 | + public function testBestOfWidgetAjax() { |
|
11 | + $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
12 | + include_once($template); |
|
13 | + |
|
14 | + $time = current_time('mysql'); |
|
15 | + |
|
16 | + $query_args = array( |
|
17 | + 'post_status' => 'publish', |
|
18 | + 'post_type' => 'gd_place', |
|
19 | + 'posts_per_page' => 1, |
|
20 | + ); |
|
21 | + |
|
22 | + $all_posts = new WP_Query( $query_args ); |
|
23 | + $post_id = null; |
|
24 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
25 | + $post_id = get_the_ID(); |
|
26 | + endwhile; |
|
27 | + |
|
28 | + $this->assertTrue(is_int($post_id)); |
|
29 | + |
|
30 | + $data = array( |
|
31 | + 'comment_post_ID' => $post_id, |
|
32 | + 'comment_author' => 'admin', |
|
33 | + 'comment_author_email' => '[email protected]', |
|
34 | + 'comment_author_url' => 'http://wpgeodirectory.com', |
|
35 | + 'comment_content' => 'content here', |
|
36 | + 'comment_type' => '', |
|
37 | + 'comment_parent' => 0, |
|
38 | + 'user_id' => 1, |
|
39 | + 'comment_author_IP' => '127.0.0.1', |
|
40 | + 'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)', |
|
41 | + 'comment_date' => $time, |
|
42 | + 'comment_approved' => 1, |
|
43 | + ); |
|
44 | + |
|
45 | + $comment_id = wp_insert_comment($data); |
|
46 | + |
|
47 | + $_REQUEST['geodir_overallrating'] = 5.0; |
|
48 | + geodir_save_rating($comment_id); |
|
49 | + |
|
50 | + $this->assertTrue(is_int($comment_id)); |
|
51 | + |
|
52 | + //ajax function test |
|
53 | + $ajax_nonce = wp_create_nonce("geodir-bestof-nonce"); |
|
54 | + |
|
55 | + $terms = get_terms( array( |
|
56 | + 'taxonomy' => 'gd_placecategory', |
|
57 | + 'hide_empty' => false, |
|
58 | + ) ); |
|
59 | + $term_id = $terms[0]->term_id; |
|
60 | + |
|
61 | + $_POST['post_type'] = 'gd_place'; |
|
62 | + $_POST['post_limit'] = '5'; |
|
63 | + $_POST['char_count'] = '20'; |
|
64 | + $_POST['taxonomy'] = 'gd_placecategory'; |
|
65 | + $_POST['add_location_filter'] = '1'; |
|
66 | + $_POST['term_id'] = (string) $term_id; |
|
67 | + $_POST['excerpt_type'] = 'show-reviews'; |
|
68 | + $_POST['geodir_bestof_nonce'] = $ajax_nonce; |
|
69 | + |
|
70 | + $this->_handleAjax('geodir_bestof'); |
|
71 | + $this->assertContains("bestof-cat-title", $this->_last_response); |
|
72 | + |
|
73 | + |
|
74 | + } |
|
75 | + |
|
76 | + public function texstImportExport() { |
|
77 | + $nonce = wp_create_nonce( 'geodir_import_export_nonce' ); |
|
78 | + |
|
79 | + $_POST['_nonce'] = $nonce; |
|
80 | + $_POST['_pt'] = 'gd_place'; |
|
81 | + $_POST['task'] = 'export_posts'; |
|
82 | + $_POST['_n'] = 5000; |
|
83 | + $_POST['_p'] = 1; |
|
84 | + |
|
85 | + $this->_handleAjax('geodir_import_export'); |
|
86 | + try { |
|
87 | + $this->assertContains("bestof-cat-title", $this->_last_response); |
|
88 | + } catch (WPAjaxDieStopException $e) { |
|
89 | + var_dump("WPAjaxDieStopException: " . $e ); |
|
90 | + } catch (WPAjaxDieContinueException $e) { |
|
91 | + var_dump("WPAjaxDieContinueException: " . $e ); |
|
92 | + } |
|
93 | + |
|
94 | + } |
|
95 | + |
|
96 | + public function tearDown() |
|
97 | + { |
|
98 | + parent::tearDown(); |
|
99 | + } |
|
100 | 100 | } |
101 | 101 | ?> |
102 | 102 | \ No newline at end of file |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | } |
9 | 9 | |
10 | 10 | public function testBestOfWidgetAjax() { |
11 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
11 | + $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
12 | 12 | include_once($template); |
13 | 13 | |
14 | 14 | $time = current_time('mysql'); |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | 'posts_per_page' => 1, |
20 | 20 | ); |
21 | 21 | |
22 | - $all_posts = new WP_Query( $query_args ); |
|
22 | + $all_posts = new WP_Query($query_args); |
|
23 | 23 | $post_id = null; |
24 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
24 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
25 | 25 | $post_id = get_the_ID(); |
26 | 26 | endwhile; |
27 | 27 | |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | //ajax function test |
53 | 53 | $ajax_nonce = wp_create_nonce("geodir-bestof-nonce"); |
54 | 54 | |
55 | - $terms = get_terms( array( |
|
55 | + $terms = get_terms(array( |
|
56 | 56 | 'taxonomy' => 'gd_placecategory', |
57 | 57 | 'hide_empty' => false, |
58 | - ) ); |
|
58 | + )); |
|
59 | 59 | $term_id = $terms[0]->term_id; |
60 | 60 | |
61 | 61 | $_POST['post_type'] = 'gd_place'; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | public function texstImportExport() { |
77 | - $nonce = wp_create_nonce( 'geodir_import_export_nonce' ); |
|
77 | + $nonce = wp_create_nonce('geodir_import_export_nonce'); |
|
78 | 78 | |
79 | 79 | $_POST['_nonce'] = $nonce; |
80 | 80 | $_POST['_pt'] = 'gd_place'; |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | try { |
87 | 87 | $this->assertContains("bestof-cat-title", $this->_last_response); |
88 | 88 | } catch (WPAjaxDieStopException $e) { |
89 | - var_dump("WPAjaxDieStopException: " . $e ); |
|
89 | + var_dump("WPAjaxDieStopException: ".$e); |
|
90 | 90 | } catch (WPAjaxDieContinueException $e) { |
91 | - var_dump("WPAjaxDieContinueException: " . $e ); |
|
91 | + var_dump("WPAjaxDieContinueException: ".$e); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | } |
@@ -1,68 +1,68 @@ |
||
1 | 1 | <?php |
2 | 2 | class UserTest extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + } |
|
9 | 9 | |
10 | - public function testDisplayUserFavorites() { |
|
10 | + public function testDisplayUserFavorites() { |
|
11 | 11 | |
12 | - global $current_user; |
|
12 | + global $current_user; |
|
13 | 13 | |
14 | - $user_id = $current_user->ID; |
|
14 | + $user_id = $current_user->ID; |
|
15 | 15 | |
16 | - $query_args = array( |
|
17 | - 'post_status' => 'publish', |
|
18 | - 'post_type' => 'gd_place', |
|
19 | - 'posts_per_page' => 1, |
|
20 | - ); |
|
16 | + $query_args = array( |
|
17 | + 'post_status' => 'publish', |
|
18 | + 'post_type' => 'gd_place', |
|
19 | + 'posts_per_page' => 1, |
|
20 | + ); |
|
21 | 21 | |
22 | - $all_posts = new WP_Query( $query_args ); |
|
23 | - $post_id = null; |
|
24 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
25 | - $post_id = get_the_ID(); |
|
26 | - endwhile; |
|
22 | + $all_posts = new WP_Query( $query_args ); |
|
23 | + $post_id = null; |
|
24 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
25 | + $post_id = get_the_ID(); |
|
26 | + endwhile; |
|
27 | 27 | |
28 | - $this->assertTrue(is_int($post_id)); |
|
28 | + $this->assertTrue(is_int($post_id)); |
|
29 | 29 | |
30 | - ob_start(); |
|
31 | - geodir_add_to_favorite($post_id); |
|
32 | - $output = ob_get_contents(); |
|
33 | - ob_end_clean(); |
|
34 | - $this->assertContains( 'Remove from Favorites', $output ); |
|
30 | + ob_start(); |
|
31 | + geodir_add_to_favorite($post_id); |
|
32 | + $output = ob_get_contents(); |
|
33 | + ob_end_clean(); |
|
34 | + $this->assertContains( 'Remove from Favorites', $output ); |
|
35 | 35 | |
36 | 36 | |
37 | - $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
37 | + $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
38 | 38 | |
39 | - $this->assertContains( $post_id, $user_fav_posts ); |
|
39 | + $this->assertContains( $post_id, $user_fav_posts ); |
|
40 | 40 | |
41 | - ob_start(); |
|
42 | - geodir_user_show_favourites($user_id); |
|
43 | - $output = ob_get_contents(); |
|
44 | - ob_end_clean(); |
|
45 | - $this->assertContains( 'geodir_my_favourites', $output ); |
|
41 | + ob_start(); |
|
42 | + geodir_user_show_favourites($user_id); |
|
43 | + $output = ob_get_contents(); |
|
44 | + ob_end_clean(); |
|
45 | + $this->assertContains( 'geodir_my_favourites', $output ); |
|
46 | 46 | |
47 | - } |
|
47 | + } |
|
48 | 48 | |
49 | - public function testDisplayUserListings() { |
|
49 | + public function testDisplayUserListings() { |
|
50 | 50 | |
51 | - global $current_user; |
|
51 | + global $current_user; |
|
52 | 52 | |
53 | - $user_id = $current_user->ID; |
|
53 | + $user_id = $current_user->ID; |
|
54 | 54 | |
55 | - ob_start(); |
|
56 | - geodir_user_show_listings($user_id); |
|
57 | - $output = ob_get_contents(); |
|
58 | - ob_end_clean(); |
|
59 | - $this->assertContains( 'geodir_my_listings', $output ); |
|
55 | + ob_start(); |
|
56 | + geodir_user_show_listings($user_id); |
|
57 | + $output = ob_get_contents(); |
|
58 | + ob_end_clean(); |
|
59 | + $this->assertContains( 'geodir_my_listings', $output ); |
|
60 | 60 | |
61 | - } |
|
61 | + } |
|
62 | 62 | |
63 | - public function tearDown() |
|
64 | - { |
|
65 | - parent::tearDown(); |
|
66 | - } |
|
63 | + public function tearDown() |
|
64 | + { |
|
65 | + parent::tearDown(); |
|
66 | + } |
|
67 | 67 | } |
68 | 68 | ?> |
69 | 69 | \ No newline at end of file |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | 'posts_per_page' => 1, |
20 | 20 | ); |
21 | 21 | |
22 | - $all_posts = new WP_Query( $query_args ); |
|
22 | + $all_posts = new WP_Query($query_args); |
|
23 | 23 | $post_id = null; |
24 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
24 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
25 | 25 | $post_id = get_the_ID(); |
26 | 26 | endwhile; |
27 | 27 | |
@@ -31,18 +31,18 @@ discard block |
||
31 | 31 | geodir_add_to_favorite($post_id); |
32 | 32 | $output = ob_get_contents(); |
33 | 33 | ob_end_clean(); |
34 | - $this->assertContains( 'Remove from Favorites', $output ); |
|
34 | + $this->assertContains('Remove from Favorites', $output); |
|
35 | 35 | |
36 | 36 | |
37 | 37 | $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
38 | 38 | |
39 | - $this->assertContains( $post_id, $user_fav_posts ); |
|
39 | + $this->assertContains($post_id, $user_fav_posts); |
|
40 | 40 | |
41 | 41 | ob_start(); |
42 | 42 | geodir_user_show_favourites($user_id); |
43 | 43 | $output = ob_get_contents(); |
44 | 44 | ob_end_clean(); |
45 | - $this->assertContains( 'geodir_my_favourites', $output ); |
|
45 | + $this->assertContains('geodir_my_favourites', $output); |
|
46 | 46 | |
47 | 47 | } |
48 | 48 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | geodir_user_show_listings($user_id); |
57 | 57 | $output = ob_get_contents(); |
58 | 58 | ob_end_clean(); |
59 | - $this->assertContains( 'geodir_my_listings', $output ); |
|
59 | + $this->assertContains('geodir_my_listings', $output); |
|
60 | 60 | |
61 | 61 | } |
62 | 62 |
@@ -29,7 +29,7 @@ |
||
29 | 29 | function drop_tables() { |
30 | 30 | global $wpdb, $plugin_prefix; |
31 | 31 | //build our query to delete our custom table |
32 | - $sql = "DROP TABLE IF EXISTS " . GEODIR_COUNTRIES_TABLE . ", " . GEODIR_ICON_TABLE . ", " . GEODIR_CUSTOM_FIELDS_TABLE . ", " . $plugin_prefix . "gd_place_detail, " . GEODIR_ATTACHMENT_TABLE . ", " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . ", " . GEODIR_REVIEW_TABLE . ";"; |
|
32 | + $sql = "DROP TABLE IF EXISTS ".GEODIR_COUNTRIES_TABLE.", ".GEODIR_ICON_TABLE.", ".GEODIR_CUSTOM_FIELDS_TABLE.", ".$plugin_prefix."gd_place_detail, ".GEODIR_ATTACHMENT_TABLE.", ".GEODIR_CUSTOM_SORT_FIELDS_TABLE.", ".GEODIR_REVIEW_TABLE.";"; |
|
33 | 33 | |
34 | 34 | //execute the query deleting the table |
35 | 35 | $wpdb->query($sql); |
@@ -1,89 +1,89 @@ |
||
1 | 1 | <?php |
2 | 2 | class Favourites extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + } |
|
9 | 9 | |
10 | - public function testAddFavourite() |
|
11 | - { |
|
12 | - global $current_user; |
|
10 | + public function testAddFavourite() |
|
11 | + { |
|
12 | + global $current_user; |
|
13 | 13 | |
14 | - $user_id = $current_user->ID; |
|
14 | + $user_id = $current_user->ID; |
|
15 | 15 | |
16 | - $query_args = array( |
|
17 | - 'post_status' => 'publish', |
|
18 | - 'post_type' => 'gd_place', |
|
19 | - 'posts_per_page' => 1, |
|
20 | - ); |
|
16 | + $query_args = array( |
|
17 | + 'post_status' => 'publish', |
|
18 | + 'post_type' => 'gd_place', |
|
19 | + 'posts_per_page' => 1, |
|
20 | + ); |
|
21 | 21 | |
22 | - $all_posts = new WP_Query( $query_args ); |
|
23 | - $post_id = null; |
|
24 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
25 | - $post_id = get_the_ID(); |
|
26 | - endwhile; |
|
22 | + $all_posts = new WP_Query( $query_args ); |
|
23 | + $post_id = null; |
|
24 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
25 | + $post_id = get_the_ID(); |
|
26 | + endwhile; |
|
27 | 27 | |
28 | - $this->assertTrue(is_int($post_id)); |
|
28 | + $this->assertTrue(is_int($post_id)); |
|
29 | 29 | |
30 | - ob_start(); |
|
31 | - geodir_add_to_favorite($post_id); |
|
32 | - $output = ob_get_clean(); |
|
33 | - $this->assertContains( 'Remove from Favorites', $output ); |
|
30 | + ob_start(); |
|
31 | + geodir_add_to_favorite($post_id); |
|
32 | + $output = ob_get_clean(); |
|
33 | + $this->assertContains( 'Remove from Favorites', $output ); |
|
34 | 34 | |
35 | 35 | |
36 | - $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
36 | + $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
37 | 37 | |
38 | - $this->assertContains( $post_id, $user_fav_posts ); |
|
38 | + $this->assertContains( $post_id, $user_fav_posts ); |
|
39 | 39 | |
40 | 40 | |
41 | - } |
|
41 | + } |
|
42 | 42 | |
43 | - public function testRemoveFavourite() |
|
44 | - { |
|
45 | - global $current_user; |
|
43 | + public function testRemoveFavourite() |
|
44 | + { |
|
45 | + global $current_user; |
|
46 | 46 | |
47 | - $user_id = $current_user->ID; |
|
47 | + $user_id = $current_user->ID; |
|
48 | 48 | |
49 | - $query_args = array( |
|
50 | - 'post_status' => 'publish', |
|
51 | - 'post_type' => 'gd_place', |
|
52 | - 'posts_per_page' => 1, |
|
53 | - ); |
|
49 | + $query_args = array( |
|
50 | + 'post_status' => 'publish', |
|
51 | + 'post_type' => 'gd_place', |
|
52 | + 'posts_per_page' => 1, |
|
53 | + ); |
|
54 | 54 | |
55 | - $all_posts = new WP_Query( $query_args ); |
|
56 | - $post_id = null; |
|
57 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
58 | - $post_id = get_the_ID(); |
|
59 | - endwhile; |
|
55 | + $all_posts = new WP_Query( $query_args ); |
|
56 | + $post_id = null; |
|
57 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
58 | + $post_id = get_the_ID(); |
|
59 | + endwhile; |
|
60 | 60 | |
61 | - $this->assertTrue(is_int($post_id)); |
|
61 | + $this->assertTrue(is_int($post_id)); |
|
62 | 62 | |
63 | - ob_start(); |
|
64 | - geodir_add_to_favorite($post_id); |
|
65 | - $output = ob_get_clean(); |
|
66 | - $this->assertContains( 'Remove from Favorites', $output ); |
|
63 | + ob_start(); |
|
64 | + geodir_add_to_favorite($post_id); |
|
65 | + $output = ob_get_clean(); |
|
66 | + $this->assertContains( 'Remove from Favorites', $output ); |
|
67 | 67 | |
68 | 68 | |
69 | - $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
69 | + $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
70 | 70 | |
71 | - $this->assertContains( $post_id, $user_fav_posts ); |
|
71 | + $this->assertContains( $post_id, $user_fav_posts ); |
|
72 | 72 | |
73 | - ob_start(); |
|
74 | - geodir_remove_from_favorite($post_id); |
|
75 | - $output = ob_get_clean(); |
|
76 | - $this->assertContains( 'Add to Favorites', $output ); |
|
73 | + ob_start(); |
|
74 | + geodir_remove_from_favorite($post_id); |
|
75 | + $output = ob_get_clean(); |
|
76 | + $this->assertContains( 'Add to Favorites', $output ); |
|
77 | 77 | |
78 | - $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
78 | + $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
79 | 79 | |
80 | - $this->assertNotContains( $post_id, $user_fav_posts ); |
|
81 | - } |
|
80 | + $this->assertNotContains( $post_id, $user_fav_posts ); |
|
81 | + } |
|
82 | 82 | |
83 | 83 | |
84 | - public function tearDown() |
|
85 | - { |
|
86 | - parent::tearDown(); |
|
87 | - } |
|
84 | + public function tearDown() |
|
85 | + { |
|
86 | + parent::tearDown(); |
|
87 | + } |
|
88 | 88 | } |
89 | 89 | ?> |
90 | 90 | \ No newline at end of file |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | 'posts_per_page' => 1, |
20 | 20 | ); |
21 | 21 | |
22 | - $all_posts = new WP_Query( $query_args ); |
|
22 | + $all_posts = new WP_Query($query_args); |
|
23 | 23 | $post_id = null; |
24 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
24 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
25 | 25 | $post_id = get_the_ID(); |
26 | 26 | endwhile; |
27 | 27 | |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | ob_start(); |
31 | 31 | geodir_add_to_favorite($post_id); |
32 | 32 | $output = ob_get_clean(); |
33 | - $this->assertContains( 'Remove from Favorites', $output ); |
|
33 | + $this->assertContains('Remove from Favorites', $output); |
|
34 | 34 | |
35 | 35 | |
36 | 36 | $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
37 | 37 | |
38 | - $this->assertContains( $post_id, $user_fav_posts ); |
|
38 | + $this->assertContains($post_id, $user_fav_posts); |
|
39 | 39 | |
40 | 40 | |
41 | 41 | } |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | 'posts_per_page' => 1, |
53 | 53 | ); |
54 | 54 | |
55 | - $all_posts = new WP_Query( $query_args ); |
|
55 | + $all_posts = new WP_Query($query_args); |
|
56 | 56 | $post_id = null; |
57 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
57 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
58 | 58 | $post_id = get_the_ID(); |
59 | 59 | endwhile; |
60 | 60 | |
@@ -63,21 +63,21 @@ discard block |
||
63 | 63 | ob_start(); |
64 | 64 | geodir_add_to_favorite($post_id); |
65 | 65 | $output = ob_get_clean(); |
66 | - $this->assertContains( 'Remove from Favorites', $output ); |
|
66 | + $this->assertContains('Remove from Favorites', $output); |
|
67 | 67 | |
68 | 68 | |
69 | 69 | $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
70 | 70 | |
71 | - $this->assertContains( $post_id, $user_fav_posts ); |
|
71 | + $this->assertContains($post_id, $user_fav_posts); |
|
72 | 72 | |
73 | 73 | ob_start(); |
74 | 74 | geodir_remove_from_favorite($post_id); |
75 | 75 | $output = ob_get_clean(); |
76 | - $this->assertContains( 'Add to Favorites', $output ); |
|
76 | + $this->assertContains('Add to Favorites', $output); |
|
77 | 77 | |
78 | 78 | $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
79 | 79 | |
80 | - $this->assertNotContains( $post_id, $user_fav_posts ); |
|
80 | + $this->assertNotContains($post_id, $user_fav_posts); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 |
@@ -1,102 +1,102 @@ |
||
1 | 1 | <?php |
2 | 2 | class MiscTests extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + } |
|
9 | 9 | |
10 | - public function testOptionDesignSettings() { |
|
10 | + public function testOptionDesignSettings() { |
|
11 | 11 | |
12 | - geodir_post_type_setting_fun(); |
|
13 | - global $geodir_settings; |
|
12 | + geodir_post_type_setting_fun(); |
|
13 | + global $geodir_settings; |
|
14 | 14 | |
15 | - $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/design_settings_array.php'; |
|
16 | - include_once($template); |
|
15 | + $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/design_settings_array.php'; |
|
16 | + include_once($template); |
|
17 | 17 | |
18 | - $output = $geodir_settings['design_settings']; |
|
18 | + $output = $geodir_settings['design_settings']; |
|
19 | 19 | |
20 | - $this->assertContains('Home Top Section Settings', $output[1]['name']); |
|
21 | - } |
|
20 | + $this->assertContains('Home Top Section Settings', $output[1]['name']); |
|
21 | + } |
|
22 | 22 | |
23 | - public function testOptionGeneralSettings() { |
|
23 | + public function testOptionGeneralSettings() { |
|
24 | 24 | |
25 | - geodir_post_type_setting_fun(); |
|
26 | - global $geodir_settings; |
|
25 | + geodir_post_type_setting_fun(); |
|
26 | + global $geodir_settings; |
|
27 | 27 | |
28 | - $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/general_settings_array.php'; |
|
29 | - include_once($template); |
|
28 | + $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/general_settings_array.php'; |
|
29 | + include_once($template); |
|
30 | 30 | |
31 | - $output = $geodir_settings['general_settings']; |
|
31 | + $output = $geodir_settings['general_settings']; |
|
32 | 32 | |
33 | - $this->assertContains('General', $output[0]['name']); |
|
34 | - } |
|
33 | + $this->assertContains('General', $output[0]['name']); |
|
34 | + } |
|
35 | 35 | |
36 | - public function testOptionNotiSettings() { |
|
36 | + public function testOptionNotiSettings() { |
|
37 | 37 | |
38 | - geodir_post_type_setting_fun(); |
|
39 | - global $geodir_settings; |
|
38 | + geodir_post_type_setting_fun(); |
|
39 | + global $geodir_settings; |
|
40 | 40 | |
41 | - $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/notifications_settings_array.php'; |
|
42 | - include_once($template); |
|
41 | + $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/notifications_settings_array.php'; |
|
42 | + include_once($template); |
|
43 | 43 | |
44 | - $output = $geodir_settings['notifications_settings']; |
|
44 | + $output = $geodir_settings['notifications_settings']; |
|
45 | 45 | |
46 | - $this->assertContains('Options', $output[0]['name']); |
|
47 | - } |
|
46 | + $this->assertContains('Options', $output[0]['name']); |
|
47 | + } |
|
48 | 48 | |
49 | - public function testOptionPermalinkSettings() { |
|
49 | + public function testOptionPermalinkSettings() { |
|
50 | 50 | |
51 | - geodir_post_type_setting_fun(); |
|
52 | - global $geodir_settings; |
|
51 | + geodir_post_type_setting_fun(); |
|
52 | + global $geodir_settings; |
|
53 | 53 | |
54 | - $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/permalink_settings_array.php'; |
|
55 | - include_once($template); |
|
54 | + $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/permalink_settings_array.php'; |
|
55 | + include_once($template); |
|
56 | 56 | |
57 | - $output = $geodir_settings['permalink_settings']; |
|
57 | + $output = $geodir_settings['permalink_settings']; |
|
58 | 58 | |
59 | - $this->assertContains('Permalink', $output[0]['name']); |
|
60 | - } |
|
59 | + $this->assertContains('Permalink', $output[0]['name']); |
|
60 | + } |
|
61 | 61 | |
62 | - public function testOptionMetaSettings() { |
|
62 | + public function testOptionMetaSettings() { |
|
63 | 63 | |
64 | - geodir_post_type_setting_fun(); |
|
65 | - global $geodir_settings; |
|
64 | + geodir_post_type_setting_fun(); |
|
65 | + global $geodir_settings; |
|
66 | 66 | |
67 | - $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/title_meta_settings_array.php'; |
|
68 | - include_once($template); |
|
67 | + $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/title_meta_settings_array.php'; |
|
68 | + include_once($template); |
|
69 | 69 | |
70 | - $output = $geodir_settings['title_meta_settings']; |
|
70 | + $output = $geodir_settings['title_meta_settings']; |
|
71 | 71 | |
72 | - $this->assertContains('Title / Meta', $output[0]['name']); |
|
73 | - } |
|
72 | + $this->assertContains('Title / Meta', $output[0]['name']); |
|
73 | + } |
|
74 | 74 | |
75 | - public function testDiagnose() { |
|
76 | - ob_start(); |
|
77 | - geodir_diagnose_default_pages(); |
|
78 | - $output = ob_get_contents(); |
|
79 | - ob_end_clean(); |
|
80 | - $this->assertContains( 'GD Home page exists with proper setting', $output ); |
|
81 | - $this->assertContains( 'Add Listing page exists with proper setting', $output ); |
|
82 | - $this->assertContains( 'Listing Preview page exists with proper setting', $output ); |
|
83 | - $this->assertContains( 'Listing Success page exists with proper setting', $output ); |
|
84 | - $this->assertContains( 'Info page exists with proper setting', $output ); |
|
85 | - $this->assertContains( 'Login page exists with proper setting', $output ); |
|
86 | - $this->assertContains( 'Location page exists with proper setting', $output ); |
|
75 | + public function testDiagnose() { |
|
76 | + ob_start(); |
|
77 | + geodir_diagnose_default_pages(); |
|
78 | + $output = ob_get_contents(); |
|
79 | + ob_end_clean(); |
|
80 | + $this->assertContains( 'GD Home page exists with proper setting', $output ); |
|
81 | + $this->assertContains( 'Add Listing page exists with proper setting', $output ); |
|
82 | + $this->assertContains( 'Listing Preview page exists with proper setting', $output ); |
|
83 | + $this->assertContains( 'Listing Success page exists with proper setting', $output ); |
|
84 | + $this->assertContains( 'Info page exists with proper setting', $output ); |
|
85 | + $this->assertContains( 'Login page exists with proper setting', $output ); |
|
86 | + $this->assertContains( 'Location page exists with proper setting', $output ); |
|
87 | 87 | |
88 | - ob_start(); |
|
89 | - geodir_diagnose_load_db_language(); |
|
90 | - $output = ob_get_contents(); |
|
91 | - ob_end_clean(); |
|
92 | - $this->assertContains( 'ul', $output ); |
|
88 | + ob_start(); |
|
89 | + geodir_diagnose_load_db_language(); |
|
90 | + $output = ob_get_contents(); |
|
91 | + ob_end_clean(); |
|
92 | + $this->assertContains( 'ul', $output ); |
|
93 | 93 | |
94 | - } |
|
94 | + } |
|
95 | 95 | |
96 | - public function tearDown() |
|
97 | - { |
|
98 | - parent::tearDown(); |
|
99 | - } |
|
96 | + public function tearDown() |
|
97 | + { |
|
98 | + parent::tearDown(); |
|
99 | + } |
|
100 | 100 | |
101 | 101 | } |
102 | 102 | ?> |
103 | 103 | \ No newline at end of file |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | geodir_post_type_setting_fun(); |
13 | 13 | global $geodir_settings; |
14 | 14 | |
15 | - $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/design_settings_array.php'; |
|
15 | + $template = geodir_plugin_path().'/geodirectory-admin/option-pages/design_settings_array.php'; |
|
16 | 16 | include_once($template); |
17 | 17 | |
18 | 18 | $output = $geodir_settings['design_settings']; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | geodir_post_type_setting_fun(); |
26 | 26 | global $geodir_settings; |
27 | 27 | |
28 | - $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/general_settings_array.php'; |
|
28 | + $template = geodir_plugin_path().'/geodirectory-admin/option-pages/general_settings_array.php'; |
|
29 | 29 | include_once($template); |
30 | 30 | |
31 | 31 | $output = $geodir_settings['general_settings']; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | geodir_post_type_setting_fun(); |
39 | 39 | global $geodir_settings; |
40 | 40 | |
41 | - $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/notifications_settings_array.php'; |
|
41 | + $template = geodir_plugin_path().'/geodirectory-admin/option-pages/notifications_settings_array.php'; |
|
42 | 42 | include_once($template); |
43 | 43 | |
44 | 44 | $output = $geodir_settings['notifications_settings']; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | geodir_post_type_setting_fun(); |
52 | 52 | global $geodir_settings; |
53 | 53 | |
54 | - $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/permalink_settings_array.php'; |
|
54 | + $template = geodir_plugin_path().'/geodirectory-admin/option-pages/permalink_settings_array.php'; |
|
55 | 55 | include_once($template); |
56 | 56 | |
57 | 57 | $output = $geodir_settings['permalink_settings']; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | geodir_post_type_setting_fun(); |
65 | 65 | global $geodir_settings; |
66 | 66 | |
67 | - $template = geodir_plugin_path() . '/geodirectory-admin/option-pages/title_meta_settings_array.php'; |
|
67 | + $template = geodir_plugin_path().'/geodirectory-admin/option-pages/title_meta_settings_array.php'; |
|
68 | 68 | include_once($template); |
69 | 69 | |
70 | 70 | $output = $geodir_settings['title_meta_settings']; |
@@ -77,19 +77,19 @@ discard block |
||
77 | 77 | geodir_diagnose_default_pages(); |
78 | 78 | $output = ob_get_contents(); |
79 | 79 | ob_end_clean(); |
80 | - $this->assertContains( 'GD Home page exists with proper setting', $output ); |
|
81 | - $this->assertContains( 'Add Listing page exists with proper setting', $output ); |
|
82 | - $this->assertContains( 'Listing Preview page exists with proper setting', $output ); |
|
83 | - $this->assertContains( 'Listing Success page exists with proper setting', $output ); |
|
84 | - $this->assertContains( 'Info page exists with proper setting', $output ); |
|
85 | - $this->assertContains( 'Login page exists with proper setting', $output ); |
|
86 | - $this->assertContains( 'Location page exists with proper setting', $output ); |
|
80 | + $this->assertContains('GD Home page exists with proper setting', $output); |
|
81 | + $this->assertContains('Add Listing page exists with proper setting', $output); |
|
82 | + $this->assertContains('Listing Preview page exists with proper setting', $output); |
|
83 | + $this->assertContains('Listing Success page exists with proper setting', $output); |
|
84 | + $this->assertContains('Info page exists with proper setting', $output); |
|
85 | + $this->assertContains('Login page exists with proper setting', $output); |
|
86 | + $this->assertContains('Location page exists with proper setting', $output); |
|
87 | 87 | |
88 | 88 | ob_start(); |
89 | 89 | geodir_diagnose_load_db_language(); |
90 | 90 | $output = ob_get_contents(); |
91 | 91 | ob_end_clean(); |
92 | - $this->assertContains( 'ul', $output ); |
|
92 | + $this->assertContains('ul', $output); |
|
93 | 93 | |
94 | 94 | } |
95 | 95 |
@@ -1,75 +1,75 @@ |
||
1 | 1 | <?php |
2 | 2 | class AdminTests extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + } |
|
9 | 9 | |
10 | - public function testAdminPanel() |
|
11 | - { |
|
10 | + public function testAdminPanel() |
|
11 | + { |
|
12 | 12 | |
13 | - $_POST = array( |
|
14 | - 'geodir_wrapper_open_id' => '', |
|
15 | - 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
16 | - 'geodir_wrapper_open_replace' => '', |
|
17 | - 'geodir_wrapper_close_replace' => '', |
|
18 | - 'geodir_wrapper_content_open_id' => '', |
|
19 | - 'geodir_wrapper_content_open_class' => '', |
|
20 | - 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
21 | - 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
22 | - 'geodir_article_open_id' => '', |
|
23 | - 'geodir_article_open_class' => '', |
|
24 | - 'geodir_article_open_replace' => '', |
|
25 | - 'geodir_article_close_replace' => '', |
|
26 | - 'geodir_sidebar_right_open_id' => '', |
|
27 | - 'geodir_sidebar_right_open_class' => '', |
|
28 | - 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
29 | - 'geodir_sidebar_right_close_replace' => '', |
|
30 | - 'geodir_sidebar_left_open_id' => '', |
|
31 | - 'geodir_sidebar_left_open_class' => '', |
|
32 | - 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
33 | - 'geodir_sidebar_left_close_replace' => '', |
|
34 | - 'geodir_main_content_open_id' => '', |
|
35 | - 'geodir_main_content_open_class' => '', |
|
36 | - 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
37 | - 'geodir_main_content_close_replace' => '</div>', |
|
38 | - 'geodir_top_content_add' => '', |
|
39 | - 'geodir_before_main_content_add' => '', |
|
40 | - 'geodir_full_page_class_filter' => 'section full-width-section', |
|
41 | - 'geodir_before_widget_filter' => '', |
|
42 | - 'geodir_after_widget_filter' => '', |
|
43 | - 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
44 | - 'geodir_after_title_filter' => '</h2></div>', |
|
45 | - 'geodir_menu_li_class_filter' => '', |
|
46 | - 'geodir_sub_menu_ul_class_filter' => '', |
|
47 | - 'geodir_sub_menu_li_class_filter' => '', |
|
48 | - 'geodir_menu_a_class_filter' => '', |
|
49 | - 'geodir_sub_menu_a_class_filter' => '', |
|
50 | - 'geodir_location_switcher_menu_li_class_filter' => '', |
|
51 | - 'geodir_location_switcher_menu_a_class_filter' => '', |
|
52 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
53 | - 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
54 | - 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'), |
|
55 | - 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});', |
|
56 | - 'geodir_theme_compat_default_options' => '', |
|
57 | - 'geodir_theme_compat_code' => 'Multi_News', |
|
58 | - 'gd_theme_compat' => 'Twenty_Fifteen_custom' |
|
59 | - ); |
|
60 | - geodir_update_options_compatibility_settings(); |
|
13 | + $_POST = array( |
|
14 | + 'geodir_wrapper_open_id' => '', |
|
15 | + 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
16 | + 'geodir_wrapper_open_replace' => '', |
|
17 | + 'geodir_wrapper_close_replace' => '', |
|
18 | + 'geodir_wrapper_content_open_id' => '', |
|
19 | + 'geodir_wrapper_content_open_class' => '', |
|
20 | + 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
21 | + 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
22 | + 'geodir_article_open_id' => '', |
|
23 | + 'geodir_article_open_class' => '', |
|
24 | + 'geodir_article_open_replace' => '', |
|
25 | + 'geodir_article_close_replace' => '', |
|
26 | + 'geodir_sidebar_right_open_id' => '', |
|
27 | + 'geodir_sidebar_right_open_class' => '', |
|
28 | + 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
29 | + 'geodir_sidebar_right_close_replace' => '', |
|
30 | + 'geodir_sidebar_left_open_id' => '', |
|
31 | + 'geodir_sidebar_left_open_class' => '', |
|
32 | + 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
33 | + 'geodir_sidebar_left_close_replace' => '', |
|
34 | + 'geodir_main_content_open_id' => '', |
|
35 | + 'geodir_main_content_open_class' => '', |
|
36 | + 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
37 | + 'geodir_main_content_close_replace' => '</div>', |
|
38 | + 'geodir_top_content_add' => '', |
|
39 | + 'geodir_before_main_content_add' => '', |
|
40 | + 'geodir_full_page_class_filter' => 'section full-width-section', |
|
41 | + 'geodir_before_widget_filter' => '', |
|
42 | + 'geodir_after_widget_filter' => '', |
|
43 | + 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
44 | + 'geodir_after_title_filter' => '</h2></div>', |
|
45 | + 'geodir_menu_li_class_filter' => '', |
|
46 | + 'geodir_sub_menu_ul_class_filter' => '', |
|
47 | + 'geodir_sub_menu_li_class_filter' => '', |
|
48 | + 'geodir_menu_a_class_filter' => '', |
|
49 | + 'geodir_sub_menu_a_class_filter' => '', |
|
50 | + 'geodir_location_switcher_menu_li_class_filter' => '', |
|
51 | + 'geodir_location_switcher_menu_a_class_filter' => '', |
|
52 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
53 | + 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
54 | + 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'), |
|
55 | + 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});', |
|
56 | + 'geodir_theme_compat_default_options' => '', |
|
57 | + 'geodir_theme_compat_code' => 'Multi_News', |
|
58 | + 'gd_theme_compat' => 'Twenty_Fifteen_custom' |
|
59 | + ); |
|
60 | + geodir_update_options_compatibility_settings(); |
|
61 | 61 | |
62 | - ob_start(); |
|
63 | - geodir_admin_panel(); |
|
64 | - $output = ob_get_contents(); |
|
65 | - ob_end_clean(); |
|
66 | - $this->assertContains( 'gd-wrapper-main', $output ); |
|
62 | + ob_start(); |
|
63 | + geodir_admin_panel(); |
|
64 | + $output = ob_get_contents(); |
|
65 | + ob_end_clean(); |
|
66 | + $this->assertContains( 'gd-wrapper-main', $output ); |
|
67 | 67 | |
68 | - } |
|
68 | + } |
|
69 | 69 | |
70 | - public function tearDown() |
|
71 | - { |
|
72 | - parent::tearDown(); |
|
73 | - } |
|
70 | + public function tearDown() |
|
71 | + { |
|
72 | + parent::tearDown(); |
|
73 | + } |
|
74 | 74 | } |
75 | 75 | ?> |
76 | 76 | \ No newline at end of file |
@@ -63,7 +63,7 @@ |
||
63 | 63 | geodir_admin_panel(); |
64 | 64 | $output = ob_get_contents(); |
65 | 65 | ob_end_clean(); |
66 | - $this->assertContains( 'gd-wrapper-main', $output ); |
|
66 | + $this->assertContains('gd-wrapper-main', $output); |
|
67 | 67 | |
68 | 68 | } |
69 | 69 |
@@ -1,102 +1,102 @@ |
||
1 | 1 | <?php |
2 | 2 | class Register extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(0); |
|
8 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(0); |
|
8 | + } |
|
9 | 9 | |
10 | - public function test_register_empty_username() { |
|
11 | - $errors = geodir_register_new_user( |
|
12 | - '', |
|
13 | - '[email protected]' |
|
14 | - ); |
|
15 | - $errors = (array) $errors; |
|
16 | - $this->assertArrayHasKey( 'empty_username', $errors["errors"] ); |
|
17 | - $this->assertContains( 'Please enter a username', $errors["errors"]["empty_username"][0] ); |
|
18 | - } |
|
10 | + public function test_register_empty_username() { |
|
11 | + $errors = geodir_register_new_user( |
|
12 | + '', |
|
13 | + '[email protected]' |
|
14 | + ); |
|
15 | + $errors = (array) $errors; |
|
16 | + $this->assertArrayHasKey( 'empty_username', $errors["errors"] ); |
|
17 | + $this->assertContains( 'Please enter a username', $errors["errors"]["empty_username"][0] ); |
|
18 | + } |
|
19 | 19 | |
20 | - public function test_register_invalid_username() { |
|
21 | - $errors = geodir_register_new_user( |
|
22 | - '@#$%^', |
|
23 | - '[email protected]' |
|
24 | - ); |
|
25 | - $errors = (array) $errors; |
|
26 | - $this->assertArrayHasKey( 'invalid_username', $errors["errors"] ); |
|
27 | - $this->assertContains( 'This username is invalid', $errors["errors"]["invalid_username"][0] ); |
|
28 | - } |
|
20 | + public function test_register_invalid_username() { |
|
21 | + $errors = geodir_register_new_user( |
|
22 | + '@#$%^', |
|
23 | + '[email protected]' |
|
24 | + ); |
|
25 | + $errors = (array) $errors; |
|
26 | + $this->assertArrayHasKey( 'invalid_username', $errors["errors"] ); |
|
27 | + $this->assertContains( 'This username is invalid', $errors["errors"]["invalid_username"][0] ); |
|
28 | + } |
|
29 | 29 | |
30 | - public function test_register_invalid_email() { |
|
31 | - $errors = geodir_register_new_user( |
|
32 | - 'hello', |
|
33 | - 'hello@@hi.com' |
|
34 | - ); |
|
35 | - $errors = (array) $errors; |
|
36 | - $this->assertArrayHasKey( 'invalid_email', $errors["errors"] ); |
|
37 | - $this->assertContains( 'The email address isn’t correct', $errors["errors"]["invalid_email"][0] ); |
|
38 | - } |
|
30 | + public function test_register_invalid_email() { |
|
31 | + $errors = geodir_register_new_user( |
|
32 | + 'hello', |
|
33 | + 'hello@@hi.com' |
|
34 | + ); |
|
35 | + $errors = (array) $errors; |
|
36 | + $this->assertArrayHasKey( 'invalid_email', $errors["errors"] ); |
|
37 | + $this->assertContains( 'The email address isn’t correct', $errors["errors"]["invalid_email"][0] ); |
|
38 | + } |
|
39 | 39 | |
40 | - public function test_register_empty_email() { |
|
41 | - $errors = geodir_register_new_user( |
|
42 | - 'hello', |
|
43 | - '' |
|
44 | - ); |
|
45 | - $errors = (array) $errors; |
|
46 | - $this->assertArrayHasKey( 'empty_email', $errors["errors"] ); |
|
47 | - $this->assertContains( 'Please type your e-mail address', $errors["errors"]["empty_email"][0] ); |
|
48 | - } |
|
40 | + public function test_register_empty_email() { |
|
41 | + $errors = geodir_register_new_user( |
|
42 | + 'hello', |
|
43 | + '' |
|
44 | + ); |
|
45 | + $errors = (array) $errors; |
|
46 | + $this->assertArrayHasKey( 'empty_email', $errors["errors"] ); |
|
47 | + $this->assertContains( 'Please type your e-mail address', $errors["errors"]["empty_email"][0] ); |
|
48 | + } |
|
49 | 49 | |
50 | - public function test_register_invalid_password() { |
|
51 | - update_option('geodir_allow_cpass', 1); |
|
52 | - $_REQUEST['user_pass'] = '12345'; |
|
53 | - $_REQUEST['user_pass2'] = '1234'; |
|
54 | - $_POST['user_fname'] = 'Test User'; |
|
55 | - $errors = geodir_register_new_user( |
|
56 | - 'hello', |
|
57 | - '[email protected]' |
|
58 | - ); |
|
59 | - $errors = (array) $errors; |
|
60 | - $this->assertArrayHasKey( 'pass_match', $errors["errors"] ); |
|
61 | - $this->assertContains( 'Passwords do not match', $errors["errors"]["pass_match"][0] ); |
|
50 | + public function test_register_invalid_password() { |
|
51 | + update_option('geodir_allow_cpass', 1); |
|
52 | + $_REQUEST['user_pass'] = '12345'; |
|
53 | + $_REQUEST['user_pass2'] = '1234'; |
|
54 | + $_POST['user_fname'] = 'Test User'; |
|
55 | + $errors = geodir_register_new_user( |
|
56 | + 'hello', |
|
57 | + '[email protected]' |
|
58 | + ); |
|
59 | + $errors = (array) $errors; |
|
60 | + $this->assertArrayHasKey( 'pass_match', $errors["errors"] ); |
|
61 | + $this->assertContains( 'Passwords do not match', $errors["errors"]["pass_match"][0] ); |
|
62 | 62 | |
63 | - $_REQUEST['user_pass'] = '12345'; |
|
64 | - $_REQUEST['user_pass2'] = '12345'; |
|
65 | - $errors = geodir_register_new_user( |
|
66 | - 'hello', |
|
67 | - '[email protected]' |
|
68 | - ); |
|
69 | - $errors = (array) $errors; |
|
70 | - $this->assertArrayHasKey( 'pass_match', $errors["errors"] ); |
|
71 | - $this->assertContains( 'Password must be 7 characters or more', $errors["errors"]["pass_match"][0] ); |
|
72 | - } |
|
63 | + $_REQUEST['user_pass'] = '12345'; |
|
64 | + $_REQUEST['user_pass2'] = '12345'; |
|
65 | + $errors = geodir_register_new_user( |
|
66 | + 'hello', |
|
67 | + '[email protected]' |
|
68 | + ); |
|
69 | + $errors = (array) $errors; |
|
70 | + $this->assertArrayHasKey( 'pass_match', $errors["errors"] ); |
|
71 | + $this->assertContains( 'Password must be 7 characters or more', $errors["errors"]["pass_match"][0] ); |
|
72 | + } |
|
73 | 73 | |
74 | - public function test_register_success() { |
|
75 | - $_POST['user_fname'] = 'Test User'; |
|
76 | - $data = geodir_register_new_user( |
|
77 | - 'hello', |
|
78 | - '[email protected]' |
|
79 | - ); |
|
80 | - $this->assertInternalType("int", $data[0]); |
|
81 | - } |
|
74 | + public function test_register_success() { |
|
75 | + $_POST['user_fname'] = 'Test User'; |
|
76 | + $data = geodir_register_new_user( |
|
77 | + 'hello', |
|
78 | + '[email protected]' |
|
79 | + ); |
|
80 | + $this->assertInternalType("int", $data[0]); |
|
81 | + } |
|
82 | 82 | |
83 | - public function testResetPassword() |
|
84 | - { |
|
85 | - global $errors; |
|
86 | - $_REQUEST['action'] = 'login'; |
|
87 | - $_POST['log'] = 'admin'; |
|
88 | - add_filter('wp_redirect', '__return_false'); |
|
89 | - geodir_user_signup(); |
|
90 | - remove_filter('wp_redirect', '__return_false'); |
|
91 | - $errors = (array) $errors; |
|
92 | - $this->assertArrayHasKey( 'empty_password', $errors["errors"] ); |
|
93 | - $this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] ); |
|
94 | - } |
|
83 | + public function testResetPassword() |
|
84 | + { |
|
85 | + global $errors; |
|
86 | + $_REQUEST['action'] = 'login'; |
|
87 | + $_POST['log'] = 'admin'; |
|
88 | + add_filter('wp_redirect', '__return_false'); |
|
89 | + geodir_user_signup(); |
|
90 | + remove_filter('wp_redirect', '__return_false'); |
|
91 | + $errors = (array) $errors; |
|
92 | + $this->assertArrayHasKey( 'empty_password', $errors["errors"] ); |
|
93 | + $this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] ); |
|
94 | + } |
|
95 | 95 | |
96 | - public function tearDown() |
|
97 | - { |
|
98 | - parent::tearDown(); |
|
99 | - } |
|
96 | + public function tearDown() |
|
97 | + { |
|
98 | + parent::tearDown(); |
|
99 | + } |
|
100 | 100 | |
101 | 101 | } |
102 | 102 | ?> |
103 | 103 | \ No newline at end of file |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | '[email protected]' |
14 | 14 | ); |
15 | 15 | $errors = (array) $errors; |
16 | - $this->assertArrayHasKey( 'empty_username', $errors["errors"] ); |
|
17 | - $this->assertContains( 'Please enter a username', $errors["errors"]["empty_username"][0] ); |
|
16 | + $this->assertArrayHasKey('empty_username', $errors["errors"]); |
|
17 | + $this->assertContains('Please enter a username', $errors["errors"]["empty_username"][0]); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | public function test_register_invalid_username() { |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | '[email protected]' |
24 | 24 | ); |
25 | 25 | $errors = (array) $errors; |
26 | - $this->assertArrayHasKey( 'invalid_username', $errors["errors"] ); |
|
27 | - $this->assertContains( 'This username is invalid', $errors["errors"]["invalid_username"][0] ); |
|
26 | + $this->assertArrayHasKey('invalid_username', $errors["errors"]); |
|
27 | + $this->assertContains('This username is invalid', $errors["errors"]["invalid_username"][0]); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function test_register_invalid_email() { |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | 'hello@@hi.com' |
34 | 34 | ); |
35 | 35 | $errors = (array) $errors; |
36 | - $this->assertArrayHasKey( 'invalid_email', $errors["errors"] ); |
|
37 | - $this->assertContains( 'The email address isn’t correct', $errors["errors"]["invalid_email"][0] ); |
|
36 | + $this->assertArrayHasKey('invalid_email', $errors["errors"]); |
|
37 | + $this->assertContains('The email address isn’t correct', $errors["errors"]["invalid_email"][0]); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | public function test_register_empty_email() { |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | '' |
44 | 44 | ); |
45 | 45 | $errors = (array) $errors; |
46 | - $this->assertArrayHasKey( 'empty_email', $errors["errors"] ); |
|
47 | - $this->assertContains( 'Please type your e-mail address', $errors["errors"]["empty_email"][0] ); |
|
46 | + $this->assertArrayHasKey('empty_email', $errors["errors"]); |
|
47 | + $this->assertContains('Please type your e-mail address', $errors["errors"]["empty_email"][0]); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | public function test_register_invalid_password() { |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | '[email protected]' |
58 | 58 | ); |
59 | 59 | $errors = (array) $errors; |
60 | - $this->assertArrayHasKey( 'pass_match', $errors["errors"] ); |
|
61 | - $this->assertContains( 'Passwords do not match', $errors["errors"]["pass_match"][0] ); |
|
60 | + $this->assertArrayHasKey('pass_match', $errors["errors"]); |
|
61 | + $this->assertContains('Passwords do not match', $errors["errors"]["pass_match"][0]); |
|
62 | 62 | |
63 | 63 | $_REQUEST['user_pass'] = '12345'; |
64 | 64 | $_REQUEST['user_pass2'] = '12345'; |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | '[email protected]' |
68 | 68 | ); |
69 | 69 | $errors = (array) $errors; |
70 | - $this->assertArrayHasKey( 'pass_match', $errors["errors"] ); |
|
71 | - $this->assertContains( 'Password must be 7 characters or more', $errors["errors"]["pass_match"][0] ); |
|
70 | + $this->assertArrayHasKey('pass_match', $errors["errors"]); |
|
71 | + $this->assertContains('Password must be 7 characters or more', $errors["errors"]["pass_match"][0]); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public function test_register_success() { |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | geodir_user_signup(); |
90 | 90 | remove_filter('wp_redirect', '__return_false'); |
91 | 91 | $errors = (array) $errors; |
92 | - $this->assertArrayHasKey( 'empty_password', $errors["errors"] ); |
|
93 | - $this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] ); |
|
92 | + $this->assertArrayHasKey('empty_password', $errors["errors"]); |
|
93 | + $this->assertContains('The password field is empty', $errors["errors"]["empty_password"][0]); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | public function tearDown() |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* Path to the WordPress codebase you'd like to test. Add a backslash in the end. */ |
4 | -define( 'ABSPATH', getenv( 'WP_CORE_DIR' ) . '/' ); |
|
4 | +define('ABSPATH', getenv('WP_CORE_DIR').'/'); |
|
5 | 5 | |
6 | 6 | // Test with multisite enabled |
7 | -define( 'WP_TESTS_MULTISITE', (bool) getenv( 'WP_MULTISITE' ) ); |
|
7 | +define('WP_TESTS_MULTISITE', (bool) getenv('WP_MULTISITE')); |
|
8 | 8 | |
9 | 9 | // Force known bugs |
10 | 10 | // define( 'WP_TESTS_FORCE_KNOWN_BUGS', true ); |
11 | 11 | |
12 | 12 | // Test with WordPress debug mode on |
13 | -define( 'WP_DEBUG', true ); |
|
13 | +define('WP_DEBUG', true); |
|
14 | 14 | |
15 | 15 | // ** MySQL settings ** // |
16 | 16 | |
@@ -21,21 +21,21 @@ discard block |
||
21 | 21 | // These tests will DROP ALL TABLES in the database with the prefix named below. |
22 | 22 | // DO NOT use a production database or one that is shared with something else. |
23 | 23 | |
24 | -define( 'DB_NAME', 'wordpress_test' ); |
|
25 | -define( 'DB_USER', 'root' ); |
|
26 | -define( 'DB_PASSWORD', 'root' ); |
|
27 | -define( 'DB_HOST', 'localhost' ); |
|
28 | -define( 'DB_CHARSET', 'utf8' ); |
|
29 | -define( 'DB_COLLATE', '' ); |
|
24 | +define('DB_NAME', 'wordpress_test'); |
|
25 | +define('DB_USER', 'root'); |
|
26 | +define('DB_PASSWORD', 'root'); |
|
27 | +define('DB_HOST', 'localhost'); |
|
28 | +define('DB_CHARSET', 'utf8'); |
|
29 | +define('DB_COLLATE', ''); |
|
30 | 30 | |
31 | -define( 'WP_TESTS_DOMAIN', 'example.org' ); |
|
32 | -define( 'WP_TESTS_EMAIL', '[email protected]' ); |
|
33 | -define( 'WP_TESTS_TITLE', 'Test Blog' ); |
|
31 | +define('WP_TESTS_DOMAIN', 'example.org'); |
|
32 | +define('WP_TESTS_EMAIL', '[email protected]'); |
|
33 | +define('WP_TESTS_TITLE', 'Test Blog'); |
|
34 | 34 | |
35 | -define( 'WP_PHP_BINARY', 'php' ); |
|
35 | +define('WP_PHP_BINARY', 'php'); |
|
36 | 36 | |
37 | -define( 'FS_CHMOD_DIR', ( 0755 & ~ umask() ) ); |
|
38 | -define( 'FS_CHMOD_FILE', ( 0644 & ~ umask() ) ); |
|
37 | +define('FS_CHMOD_DIR', (0755 & ~ umask())); |
|
38 | +define('FS_CHMOD_FILE', (0644 & ~ umask())); |
|
39 | 39 | |
40 | -define( 'WPLANG', '' ); |
|
41 | -$table_prefix = 'wptests_'; |
|
42 | 40 | \ No newline at end of file |
41 | +define('WPLANG', ''); |
|
42 | +$table_prefix = 'wptests_'; |
|
43 | 43 | \ No newline at end of file |
@@ -1,141 +1,141 @@ |
||
1 | 1 | <?php |
2 | 2 | class CheckShortcodes extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - |
|
9 | - } |
|
10 | - |
|
11 | - public function testHomeMapShortcode() |
|
12 | - { |
|
13 | - $output = do_shortcode('[gd_homepage_map width=100% height=300 scrollwheel=false]'); |
|
14 | - $this->assertContains( 'geodir-map-home-page', $output ); |
|
15 | - } |
|
16 | - |
|
17 | - public function testListingMapShortcode() |
|
18 | - { |
|
19 | - $output = do_shortcode('[gd_listing_map width=100% height=300 scrollwheel=false sticky=true]'); |
|
20 | - $this->assertContains( 'geodir-map-listing-page', $output ); |
|
21 | - } |
|
22 | - |
|
23 | - public function testListingSliderShortcode() |
|
24 | - { |
|
25 | - $output = do_shortcode('[gd_listing_slider post_number=5 category=3 slideshow=true show_featured_only=true]'); |
|
26 | - $this->assertContains( 'geodir_widget_carousel', $output ); |
|
27 | - } |
|
28 | - |
|
29 | - public function testLoginBoxShortcode() |
|
30 | - { |
|
31 | - $output = do_shortcode('[gd_login_box]'); |
|
32 | - $this->assertContains( 'geodir-loginbox-list', $output ); |
|
33 | - } |
|
34 | - |
|
35 | - public function testPopPostCatShortcode() |
|
36 | - { |
|
37 | - global $geodir_post_type; |
|
38 | - $geodir_post_type = 'gd_place'; |
|
39 | - $output = do_shortcode('[gd_popular_post_category category_limit=30]'); |
|
40 | - $this->assertContains( 'geodir-popular-cat-list', $output ); |
|
41 | - } |
|
42 | - |
|
43 | - public function testPopPostViewShortcode() |
|
44 | - { |
|
45 | - $output = do_shortcode('[gd_popular_post_view category=3 layout=5 add_location_filter=true character_count=0 show_featured_only=true]'); |
|
46 | - $this->assertContains( 'geodir_category_list_view', $output ); |
|
47 | - } |
|
48 | - |
|
49 | - public function testRecentReviewsShortcode() |
|
50 | - { |
|
51 | - $query_args = array( |
|
52 | - 'post_status' => 'publish', |
|
53 | - 'post_type' => 'gd_place', |
|
54 | - 'posts_per_page' => 1, |
|
55 | - ); |
|
56 | - |
|
57 | - $all_posts = new WP_Query( $query_args ); |
|
58 | - $post_id = null; |
|
59 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
60 | - $post_id = get_the_ID(); |
|
61 | - endwhile; |
|
62 | - |
|
63 | - $this->assertTrue(is_int($post_id)); |
|
64 | - |
|
65 | - $time = current_time('mysql'); |
|
66 | - |
|
67 | - $data = array( |
|
68 | - 'comment_post_ID' => $post_id, |
|
69 | - 'comment_author' => 'admin', |
|
70 | - 'comment_author_email' => '[email protected]', |
|
71 | - 'comment_author_url' => 'http://wpgeodirectory.com', |
|
72 | - 'comment_content' => 'content here testtcc', |
|
73 | - 'comment_type' => '', |
|
74 | - 'comment_parent' => 0, |
|
75 | - 'user_id' => 1, |
|
76 | - 'comment_author_IP' => '127.0.0.1', |
|
77 | - 'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)', |
|
78 | - 'comment_date' => $time, |
|
79 | - 'comment_approved' => 1, |
|
80 | - ); |
|
81 | - |
|
82 | - $comment_id = wp_insert_comment($data); |
|
83 | - |
|
84 | - $_REQUEST['geodir_overallrating'] = 5.0; |
|
85 | - geodir_save_rating($comment_id); |
|
86 | - |
|
87 | - $output = do_shortcode('[gd_recent_reviews count=5]'); |
|
88 | - $this->assertContains( 'geodir_sc_recent_reviews', $output ); |
|
89 | - } |
|
90 | - |
|
91 | - public function testRelatedListingsShortcode() |
|
92 | - { |
|
93 | - $query_args = array( |
|
94 | - 'post_status' => 'publish', |
|
95 | - 'post_type' => 'gd_place', |
|
96 | - 'posts_per_page' => 1, |
|
97 | - ); |
|
98 | - |
|
99 | - $all_posts = new WP_Query( $query_args ); |
|
100 | - $post_id = null; |
|
101 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
102 | - $post_id = get_the_ID(); |
|
103 | - global $post; |
|
104 | - $post = geodir_get_post_info($post_id); |
|
105 | - setup_postdata($post); |
|
106 | - $output = do_shortcode('[gd_related_listings relate_to=category layout=3 add_location_filter=0 list_sort=featured character_count=0]'); |
|
107 | - $this->assertContains( 'geodir_location_listing', $output ); |
|
108 | - endwhile; |
|
109 | - |
|
110 | - $this->assertTrue(is_int($post_id)); |
|
111 | - |
|
112 | - } |
|
113 | - |
|
114 | - public function testListingsShortcode() |
|
115 | - { |
|
116 | - $output = do_shortcode('[gd_listings post_type="gd_place" category="1,3" post_number="10" list_sort="high_review"]'); |
|
117 | - $this->assertContains( 'geodir-sc-gd-listings', $output ); |
|
118 | - } |
|
119 | - |
|
120 | - public function texstBestOfWidgetShortcode() |
|
121 | - { |
|
122 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
123 | - include_once($template); |
|
124 | - |
|
125 | - $output = do_shortcode('[gd_bestof_widget title="widget title" post_type=gd_hotel post_limit=5 categ_limit=6 character_count=50 use_viewing_post_type=true add_location_filter=true tab_layout=bestof-tabs-as-dropdown]'); |
|
126 | - $this->assertContains( 'geodir_bestof_widget', $output ); |
|
127 | - } |
|
128 | - |
|
129 | - public function testAddListingShortcode() |
|
130 | - { |
|
131 | - $_REQUEST['listing_type'] = 'gd_place'; |
|
132 | - $output = do_shortcode('[gd_add_listing listing_type=gd_place login_msg="Please register and login to submit listings" show_login=true]'); |
|
133 | - $this->assertContains( 'geodir-add-listing-submit', $output ); |
|
134 | - } |
|
135 | - |
|
136 | - public function tearDown() |
|
137 | - { |
|
138 | - parent::tearDown(); |
|
139 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + |
|
9 | + } |
|
10 | + |
|
11 | + public function testHomeMapShortcode() |
|
12 | + { |
|
13 | + $output = do_shortcode('[gd_homepage_map width=100% height=300 scrollwheel=false]'); |
|
14 | + $this->assertContains( 'geodir-map-home-page', $output ); |
|
15 | + } |
|
16 | + |
|
17 | + public function testListingMapShortcode() |
|
18 | + { |
|
19 | + $output = do_shortcode('[gd_listing_map width=100% height=300 scrollwheel=false sticky=true]'); |
|
20 | + $this->assertContains( 'geodir-map-listing-page', $output ); |
|
21 | + } |
|
22 | + |
|
23 | + public function testListingSliderShortcode() |
|
24 | + { |
|
25 | + $output = do_shortcode('[gd_listing_slider post_number=5 category=3 slideshow=true show_featured_only=true]'); |
|
26 | + $this->assertContains( 'geodir_widget_carousel', $output ); |
|
27 | + } |
|
28 | + |
|
29 | + public function testLoginBoxShortcode() |
|
30 | + { |
|
31 | + $output = do_shortcode('[gd_login_box]'); |
|
32 | + $this->assertContains( 'geodir-loginbox-list', $output ); |
|
33 | + } |
|
34 | + |
|
35 | + public function testPopPostCatShortcode() |
|
36 | + { |
|
37 | + global $geodir_post_type; |
|
38 | + $geodir_post_type = 'gd_place'; |
|
39 | + $output = do_shortcode('[gd_popular_post_category category_limit=30]'); |
|
40 | + $this->assertContains( 'geodir-popular-cat-list', $output ); |
|
41 | + } |
|
42 | + |
|
43 | + public function testPopPostViewShortcode() |
|
44 | + { |
|
45 | + $output = do_shortcode('[gd_popular_post_view category=3 layout=5 add_location_filter=true character_count=0 show_featured_only=true]'); |
|
46 | + $this->assertContains( 'geodir_category_list_view', $output ); |
|
47 | + } |
|
48 | + |
|
49 | + public function testRecentReviewsShortcode() |
|
50 | + { |
|
51 | + $query_args = array( |
|
52 | + 'post_status' => 'publish', |
|
53 | + 'post_type' => 'gd_place', |
|
54 | + 'posts_per_page' => 1, |
|
55 | + ); |
|
56 | + |
|
57 | + $all_posts = new WP_Query( $query_args ); |
|
58 | + $post_id = null; |
|
59 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
60 | + $post_id = get_the_ID(); |
|
61 | + endwhile; |
|
62 | + |
|
63 | + $this->assertTrue(is_int($post_id)); |
|
64 | + |
|
65 | + $time = current_time('mysql'); |
|
66 | + |
|
67 | + $data = array( |
|
68 | + 'comment_post_ID' => $post_id, |
|
69 | + 'comment_author' => 'admin', |
|
70 | + 'comment_author_email' => '[email protected]', |
|
71 | + 'comment_author_url' => 'http://wpgeodirectory.com', |
|
72 | + 'comment_content' => 'content here testtcc', |
|
73 | + 'comment_type' => '', |
|
74 | + 'comment_parent' => 0, |
|
75 | + 'user_id' => 1, |
|
76 | + 'comment_author_IP' => '127.0.0.1', |
|
77 | + 'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)', |
|
78 | + 'comment_date' => $time, |
|
79 | + 'comment_approved' => 1, |
|
80 | + ); |
|
81 | + |
|
82 | + $comment_id = wp_insert_comment($data); |
|
83 | + |
|
84 | + $_REQUEST['geodir_overallrating'] = 5.0; |
|
85 | + geodir_save_rating($comment_id); |
|
86 | + |
|
87 | + $output = do_shortcode('[gd_recent_reviews count=5]'); |
|
88 | + $this->assertContains( 'geodir_sc_recent_reviews', $output ); |
|
89 | + } |
|
90 | + |
|
91 | + public function testRelatedListingsShortcode() |
|
92 | + { |
|
93 | + $query_args = array( |
|
94 | + 'post_status' => 'publish', |
|
95 | + 'post_type' => 'gd_place', |
|
96 | + 'posts_per_page' => 1, |
|
97 | + ); |
|
98 | + |
|
99 | + $all_posts = new WP_Query( $query_args ); |
|
100 | + $post_id = null; |
|
101 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
102 | + $post_id = get_the_ID(); |
|
103 | + global $post; |
|
104 | + $post = geodir_get_post_info($post_id); |
|
105 | + setup_postdata($post); |
|
106 | + $output = do_shortcode('[gd_related_listings relate_to=category layout=3 add_location_filter=0 list_sort=featured character_count=0]'); |
|
107 | + $this->assertContains( 'geodir_location_listing', $output ); |
|
108 | + endwhile; |
|
109 | + |
|
110 | + $this->assertTrue(is_int($post_id)); |
|
111 | + |
|
112 | + } |
|
113 | + |
|
114 | + public function testListingsShortcode() |
|
115 | + { |
|
116 | + $output = do_shortcode('[gd_listings post_type="gd_place" category="1,3" post_number="10" list_sort="high_review"]'); |
|
117 | + $this->assertContains( 'geodir-sc-gd-listings', $output ); |
|
118 | + } |
|
119 | + |
|
120 | + public function texstBestOfWidgetShortcode() |
|
121 | + { |
|
122 | + $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
123 | + include_once($template); |
|
124 | + |
|
125 | + $output = do_shortcode('[gd_bestof_widget title="widget title" post_type=gd_hotel post_limit=5 categ_limit=6 character_count=50 use_viewing_post_type=true add_location_filter=true tab_layout=bestof-tabs-as-dropdown]'); |
|
126 | + $this->assertContains( 'geodir_bestof_widget', $output ); |
|
127 | + } |
|
128 | + |
|
129 | + public function testAddListingShortcode() |
|
130 | + { |
|
131 | + $_REQUEST['listing_type'] = 'gd_place'; |
|
132 | + $output = do_shortcode('[gd_add_listing listing_type=gd_place login_msg="Please register and login to submit listings" show_login=true]'); |
|
133 | + $this->assertContains( 'geodir-add-listing-submit', $output ); |
|
134 | + } |
|
135 | + |
|
136 | + public function tearDown() |
|
137 | + { |
|
138 | + parent::tearDown(); |
|
139 | + } |
|
140 | 140 | } |
141 | 141 | ?> |
142 | 142 | \ No newline at end of file |
@@ -11,25 +11,25 @@ discard block |
||
11 | 11 | public function testHomeMapShortcode() |
12 | 12 | { |
13 | 13 | $output = do_shortcode('[gd_homepage_map width=100% height=300 scrollwheel=false]'); |
14 | - $this->assertContains( 'geodir-map-home-page', $output ); |
|
14 | + $this->assertContains('geodir-map-home-page', $output); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | public function testListingMapShortcode() |
18 | 18 | { |
19 | 19 | $output = do_shortcode('[gd_listing_map width=100% height=300 scrollwheel=false sticky=true]'); |
20 | - $this->assertContains( 'geodir-map-listing-page', $output ); |
|
20 | + $this->assertContains('geodir-map-listing-page', $output); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function testListingSliderShortcode() |
24 | 24 | { |
25 | 25 | $output = do_shortcode('[gd_listing_slider post_number=5 category=3 slideshow=true show_featured_only=true]'); |
26 | - $this->assertContains( 'geodir_widget_carousel', $output ); |
|
26 | + $this->assertContains('geodir_widget_carousel', $output); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function testLoginBoxShortcode() |
30 | 30 | { |
31 | 31 | $output = do_shortcode('[gd_login_box]'); |
32 | - $this->assertContains( 'geodir-loginbox-list', $output ); |
|
32 | + $this->assertContains('geodir-loginbox-list', $output); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | public function testPopPostCatShortcode() |
@@ -37,13 +37,13 @@ discard block |
||
37 | 37 | global $geodir_post_type; |
38 | 38 | $geodir_post_type = 'gd_place'; |
39 | 39 | $output = do_shortcode('[gd_popular_post_category category_limit=30]'); |
40 | - $this->assertContains( 'geodir-popular-cat-list', $output ); |
|
40 | + $this->assertContains('geodir-popular-cat-list', $output); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | public function testPopPostViewShortcode() |
44 | 44 | { |
45 | 45 | $output = do_shortcode('[gd_popular_post_view category=3 layout=5 add_location_filter=true character_count=0 show_featured_only=true]'); |
46 | - $this->assertContains( 'geodir_category_list_view', $output ); |
|
46 | + $this->assertContains('geodir_category_list_view', $output); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | public function testRecentReviewsShortcode() |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | 'posts_per_page' => 1, |
55 | 55 | ); |
56 | 56 | |
57 | - $all_posts = new WP_Query( $query_args ); |
|
57 | + $all_posts = new WP_Query($query_args); |
|
58 | 58 | $post_id = null; |
59 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
59 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
60 | 60 | $post_id = get_the_ID(); |
61 | 61 | endwhile; |
62 | 62 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | geodir_save_rating($comment_id); |
86 | 86 | |
87 | 87 | $output = do_shortcode('[gd_recent_reviews count=5]'); |
88 | - $this->assertContains( 'geodir_sc_recent_reviews', $output ); |
|
88 | + $this->assertContains('geodir_sc_recent_reviews', $output); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | public function testRelatedListingsShortcode() |
@@ -96,15 +96,15 @@ discard block |
||
96 | 96 | 'posts_per_page' => 1, |
97 | 97 | ); |
98 | 98 | |
99 | - $all_posts = new WP_Query( $query_args ); |
|
99 | + $all_posts = new WP_Query($query_args); |
|
100 | 100 | $post_id = null; |
101 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
101 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
102 | 102 | $post_id = get_the_ID(); |
103 | 103 | global $post; |
104 | - $post = geodir_get_post_info($post_id); |
|
104 | + $post = geodir_get_post_info($post_id); |
|
105 | 105 | setup_postdata($post); |
106 | 106 | $output = do_shortcode('[gd_related_listings relate_to=category layout=3 add_location_filter=0 list_sort=featured character_count=0]'); |
107 | - $this->assertContains( 'geodir_location_listing', $output ); |
|
107 | + $this->assertContains('geodir_location_listing', $output); |
|
108 | 108 | endwhile; |
109 | 109 | |
110 | 110 | $this->assertTrue(is_int($post_id)); |
@@ -114,23 +114,23 @@ discard block |
||
114 | 114 | public function testListingsShortcode() |
115 | 115 | { |
116 | 116 | $output = do_shortcode('[gd_listings post_type="gd_place" category="1,3" post_number="10" list_sort="high_review"]'); |
117 | - $this->assertContains( 'geodir-sc-gd-listings', $output ); |
|
117 | + $this->assertContains('geodir-sc-gd-listings', $output); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | public function texstBestOfWidgetShortcode() |
121 | 121 | { |
122 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
122 | + $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
123 | 123 | include_once($template); |
124 | 124 | |
125 | 125 | $output = do_shortcode('[gd_bestof_widget title="widget title" post_type=gd_hotel post_limit=5 categ_limit=6 character_count=50 use_viewing_post_type=true add_location_filter=true tab_layout=bestof-tabs-as-dropdown]'); |
126 | - $this->assertContains( 'geodir_bestof_widget', $output ); |
|
126 | + $this->assertContains('geodir_bestof_widget', $output); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | public function testAddListingShortcode() |
130 | 130 | { |
131 | 131 | $_REQUEST['listing_type'] = 'gd_place'; |
132 | 132 | $output = do_shortcode('[gd_add_listing listing_type=gd_place login_msg="Please register and login to submit listings" show_login=true]'); |
133 | - $this->assertContains( 'geodir-add-listing-submit', $output ); |
|
133 | + $this->assertContains('geodir-add-listing-submit', $output); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | public function tearDown() |