@@ -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() |
@@ -1,53 +1,53 @@ |
||
1 | 1 | <?php |
2 | 2 | class AuthorPage extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + } |
|
8 | 8 | |
9 | - public function testAuthorPage() |
|
10 | - { |
|
11 | - global $current_user; |
|
9 | + public function testAuthorPage() |
|
10 | + { |
|
11 | + global $current_user; |
|
12 | 12 | |
13 | - $user_id = $current_user->ID; |
|
13 | + $user_id = $current_user->ID; |
|
14 | 14 | |
15 | 15 | |
16 | 16 | |
17 | - // Add listing |
|
17 | + // Add listing |
|
18 | 18 | |
19 | - $args = array( |
|
20 | - 'listing_type' => 'gd_place', |
|
21 | - 'post_title' => 'Test Listing Title 2', |
|
22 | - 'post_desc' => 'Test Desc', |
|
23 | - 'post_tags' => 'test1,test2', |
|
24 | - 'post_address' => 'New York City Hall', |
|
25 | - 'post_zip' => '10007', |
|
26 | - 'post_mapview' => 'ROADMAP', |
|
27 | - 'post_mapzoom' => '10', |
|
28 | - 'geodir_timing' => '10.00 am to 6 pm every day', |
|
29 | - 'geodir_contact' => '1234567890', |
|
30 | - 'geodir_email' => '[email protected]', |
|
31 | - 'geodir_website' => 'http://test.com', |
|
32 | - 'geodir_twitter' => 'http://twitter.com/test', |
|
33 | - 'geodir_facebook' => 'http://facebook.com/test', |
|
34 | - 'geodir_special_offers' => 'Test offer' |
|
35 | - ); |
|
36 | - $post_id = geodir_save_listing($args, true); |
|
19 | + $args = array( |
|
20 | + 'listing_type' => 'gd_place', |
|
21 | + 'post_title' => 'Test Listing Title 2', |
|
22 | + 'post_desc' => 'Test Desc', |
|
23 | + 'post_tags' => 'test1,test2', |
|
24 | + 'post_address' => 'New York City Hall', |
|
25 | + 'post_zip' => '10007', |
|
26 | + 'post_mapview' => 'ROADMAP', |
|
27 | + 'post_mapzoom' => '10', |
|
28 | + 'geodir_timing' => '10.00 am to 6 pm every day', |
|
29 | + 'geodir_contact' => '1234567890', |
|
30 | + 'geodir_email' => '[email protected]', |
|
31 | + 'geodir_website' => 'http://test.com', |
|
32 | + 'geodir_twitter' => 'http://twitter.com/test', |
|
33 | + 'geodir_facebook' => 'http://facebook.com/test', |
|
34 | + 'geodir_special_offers' => 'Test offer' |
|
35 | + ); |
|
36 | + $post_id = geodir_save_listing($args, true); |
|
37 | 37 | |
38 | - $this->assertTrue(is_int($post_id)); |
|
38 | + $this->assertTrue(is_int($post_id)); |
|
39 | 39 | |
40 | - $count = count_user_posts( $user_id, "gd_place" ); |
|
40 | + $count = count_user_posts( $user_id, "gd_place" ); |
|
41 | 41 | |
42 | - $this->assertTrue(is_int((int) $count)); |
|
42 | + $this->assertTrue(is_int((int) $count)); |
|
43 | 43 | |
44 | 44 | |
45 | 45 | |
46 | - } |
|
46 | + } |
|
47 | 47 | |
48 | - public function tearDown() |
|
49 | - { |
|
50 | - parent::tearDown(); |
|
51 | - } |
|
48 | + public function tearDown() |
|
49 | + { |
|
50 | + parent::tearDown(); |
|
51 | + } |
|
52 | 52 | } |
53 | 53 | ?> |
54 | 54 | \ No newline at end of file |
@@ -37,7 +37,7 @@ |
||
37 | 37 | |
38 | 38 | $this->assertTrue(is_int($post_id)); |
39 | 39 | |
40 | - $count = count_user_posts( $user_id, "gd_place" ); |
|
40 | + $count = count_user_posts($user_id, "gd_place"); |
|
41 | 41 | |
42 | 42 | $this->assertTrue(is_int((int) $count)); |
43 | 43 |