Changeset 42343 for trunk/tests/phpunit/tests/ajax/EditComment.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ajax/EditComment.php
r35242 r42343 18 18 /** 19 19 * A post with at least one comment 20 * 20 21 * @var mixed 21 22 */ … … 35 36 * Get comments as a privilged user (administrator) 36 37 * Expects test to pass 38 * 37 39 * @return void 38 40 */ … … 43 45 44 46 // Get a comment 45 $comments = get_comments( array( 46 'post_id' => $this->_comment_post->ID 47 ) ); 48 $comment = array_pop( $comments ); 47 $comments = get_comments( 48 array( 49 'post_id' => $this->_comment_post->ID, 50 ) 51 ); 52 $comment = array_pop( $comments ); 49 53 50 54 // Set up a default request … … 85 89 86 90 // Get a comment 87 $comments = get_comments( array( 88 'post_id' => $this->_comment_post->ID 89 ) ); 90 $comment = array_pop( $comments ); 91 $comments = get_comments( 92 array( 93 'post_id' => $this->_comment_post->ID, 94 ) 95 ); 96 $comment = array_pop( $comments ); 91 97 92 98 // Manually update the comment_post_ID, because wp_update_comment() will prevent it. … … 124 130 * Get comments as a non-privileged user (subscriber) 125 131 * Expects test to fail 132 * 126 133 * @return void 127 134 */ … … 132 139 133 140 // Get a comment 134 $comments = get_comments( array( 135 'post_id' => $this->_comment_post->ID 136 ) ); 137 $comment = array_pop( $comments ); 141 $comments = get_comments( 142 array( 143 'post_id' => $this->_comment_post->ID, 144 ) 145 ); 146 $comment = array_pop( $comments ); 138 147 139 148 // Set up a default request … … 150 159 * Get comments with a bad nonce 151 160 * Expects test to fail 161 * 152 162 * @return void 153 163 */ … … 158 168 159 169 // Get a comment 160 $comments = get_comments( array( 161 'post_id' => $this->_comment_post->ID 162 ) ); 163 $comment = array_pop( $comments ); 170 $comments = get_comments( 171 array( 172 'post_id' => $this->_comment_post->ID, 173 ) 174 ); 175 $comment = array_pop( $comments ); 164 176 165 177 // Set up a default request … … 176 188 * Get comments for an invalid post 177 189 * This should return valid XML 190 * 178 191 * @return void 179 192 */
Note: See TracChangeset
for help on using the changeset viewer.