@@ -3,32 +3,32 @@ discard block |
||
3 | 3 | $_SERVER['SERVER_NAME'] = ''; |
4 | 4 | $PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php'; |
5 | 5 | |
6 | -define( 'GEODIR_USE_PHP_SESSIONS', false ); |
|
7 | -define( 'GD_TESTING_MODE', true ); |
|
6 | +define('GEODIR_USE_PHP_SESSIONS', false); |
|
7 | +define('GD_TESTING_MODE', true); |
|
8 | 8 | |
9 | -$_tests_dir = getenv( 'WP_TESTS_DIR' ); |
|
9 | +$_tests_dir = getenv('WP_TESTS_DIR'); |
|
10 | 10 | |
11 | -$is_selenium_test = getenv( 'IS_SELENIUM_TEST' ); |
|
11 | +$is_selenium_test = getenv('IS_SELENIUM_TEST'); |
|
12 | 12 | |
13 | -if ( ! $is_selenium_test ) { |
|
13 | +if (!$is_selenium_test) { |
|
14 | 14 | $is_selenium_test = false; |
15 | 15 | } else { |
16 | 16 | $is_selenium_test = true; |
17 | 17 | } |
18 | 18 | |
19 | -if ( ! $_tests_dir ) { |
|
20 | - $_tests_dir = dirname( __FILE__ ) . '/lib/wordpress-tests-lib'; |
|
19 | +if (!$_tests_dir) { |
|
20 | + $_tests_dir = dirname(__FILE__).'/lib/wordpress-tests-lib'; |
|
21 | 21 | } |
22 | 22 | |
23 | -require_once $_tests_dir . '/includes/functions.php'; |
|
24 | -require $_tests_dir . '/includes/bootstrap.php'; |
|
23 | +require_once $_tests_dir.'/includes/functions.php'; |
|
24 | +require $_tests_dir.'/includes/bootstrap.php'; |
|
25 | 25 | |
26 | -if ( $is_selenium_test ) { |
|
27 | - require dirname( __FILE__ ) . '/selenium/base.php'; |
|
26 | +if ($is_selenium_test) { |
|
27 | + require dirname(__FILE__).'/selenium/base.php'; |
|
28 | 28 | } |
29 | 29 | |
30 | -if ( ! $is_selenium_test ) { |
|
31 | - require dirname( __FILE__ ) . '/../geodirectory.php'; |
|
30 | +if (!$is_selenium_test) { |
|
31 | + require dirname(__FILE__).'/../geodirectory.php'; |
|
32 | 32 | tests_add_filter('place_dummy_image_url', 'place_dummy_image_url'); |
33 | 33 | tests_add_filter('place_dummy_cat_image_url', 'place_dummy_cat_image_url'); |
34 | 34 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | function test_create_dummy_posts($max = 10) { |
88 | 88 | $i = 1; |
89 | - while($i <= $max) { |
|
89 | + while ($i <= $max) { |
|
90 | 90 | global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2; |
91 | 91 | |
92 | 92 | $dummy_post_index = $i; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $city_bound_lat2 = 40.91525559999999; |
96 | 96 | $city_bound_lng2 = -73.7002721; |
97 | 97 | |
98 | - include dirname( __FILE__ ) . '/../geodirectory-admin/place_dummy_post.php'; |
|
98 | + include dirname(__FILE__).'/../geodirectory-admin/place_dummy_post.php'; |
|
99 | 99 | $i++; |
100 | 100 | } |
101 | 101 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | |
113 | 113 | function place_dummy_image_url($url) { |
114 | - $gd_dummy_base_url = getenv( 'GD_DUMMY_BASE_URL' ); |
|
114 | + $gd_dummy_base_url = getenv('GD_DUMMY_BASE_URL'); |
|
115 | 115 | if ($gd_dummy_base_url) { |
116 | 116 | return $gd_dummy_base_url; |
117 | 117 | } else { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | } |
121 | 121 | |
122 | 122 | function place_dummy_cat_image_url($url) { |
123 | - $gd_dummy_base_url = getenv( 'GD_DUMMY_BASE_URL' ); |
|
123 | + $gd_dummy_base_url = getenv('GD_DUMMY_BASE_URL'); |
|
124 | 124 | if ($gd_dummy_base_url) { |
125 | 125 | return $gd_dummy_base_url."/cat_icon"; |
126 | 126 | } else { |
@@ -1,38 +1,38 @@ |
||
1 | 1 | <?php |
2 | 2 | class DeleteListing extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + } |
|
9 | 9 | |
10 | - public function testDeleteListing() |
|
11 | - { |
|
12 | - $query_args = array( |
|
13 | - 'post_status' => 'publish', |
|
14 | - 'post_type' => 'gd_place', |
|
15 | - 'posts_per_page' => 1, |
|
16 | - 'author' => 1 |
|
17 | - ); |
|
10 | + public function testDeleteListing() |
|
11 | + { |
|
12 | + $query_args = array( |
|
13 | + 'post_status' => 'publish', |
|
14 | + 'post_type' => 'gd_place', |
|
15 | + 'posts_per_page' => 1, |
|
16 | + 'author' => 1 |
|
17 | + ); |
|
18 | 18 | |
19 | - $all_posts = new WP_Query( $query_args ); |
|
20 | - $post_id = null; |
|
21 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
22 | - $post_id = get_the_ID(); |
|
23 | - endwhile; |
|
19 | + $all_posts = new WP_Query( $query_args ); |
|
20 | + $post_id = null; |
|
21 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
22 | + $post_id = get_the_ID(); |
|
23 | + endwhile; |
|
24 | 24 | |
25 | - $this->assertTrue(is_int($post_id)); |
|
25 | + $this->assertTrue(is_int($post_id)); |
|
26 | 26 | |
27 | - $lastid = wp_delete_post($post_id); |
|
27 | + $lastid = wp_delete_post($post_id); |
|
28 | 28 | |
29 | - $this->assertTrue(is_int($lastid->ID)); |
|
29 | + $this->assertTrue(is_int($lastid->ID)); |
|
30 | 30 | |
31 | - } |
|
31 | + } |
|
32 | 32 | |
33 | - public function tearDown() |
|
34 | - { |
|
35 | - parent::tearDown(); |
|
36 | - } |
|
33 | + public function tearDown() |
|
34 | + { |
|
35 | + parent::tearDown(); |
|
36 | + } |
|
37 | 37 | } |
38 | 38 | ?> |
39 | 39 | \ No newline at end of file |
@@ -16,9 +16,9 @@ |
||
16 | 16 | 'author' => 1 |
17 | 17 | ); |
18 | 18 | |
19 | - $all_posts = new WP_Query( $query_args ); |
|
19 | + $all_posts = new WP_Query($query_args); |
|
20 | 20 | $post_id = null; |
21 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
21 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
22 | 22 | $post_id = get_the_ID(); |
23 | 23 | endwhile; |
24 | 24 |
@@ -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() |