Changeset 34646
- Timestamp:
- 09/27/2015 10:26:16 PM (9 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/http/base.php
r34639 r34646 53 53 // 5 : 5 & 301 54 54 $res = wp_remote_request($this->redirection_script . '?code=301&rt=' . 5, array('redirection' => 5) ); 55 $this->assert False( is_wp_error($res));55 $this->assertNotWPError( $res ); 56 56 $this->assertEquals(200, (int)$res['response']['code'] ); 57 57 } … … 60 60 // 5 : 5 & 302 61 61 $res = wp_remote_request($this->redirection_script . '?code=302&rt=' . 5, array('redirection' => 5) ); 62 $this->assert False( is_wp_error($res));62 $this->assertNotWPError( $res ); 63 63 $this->assertEquals(200, (int)$res['response']['code'] ); 64 64 } … … 70 70 // 5 > 0 & 301 71 71 $res = wp_remote_request($this->redirection_script . '?code=301&rt=' . 5, array('redirection' => 0) ); 72 $this->assert False( is_wp_error($res));72 $this->assertNotWPError( $res ); 73 73 $this->assertEquals(301, (int)$res['response']['code'] ); 74 74 } … … 80 80 // 5 > 0 & 302 81 81 $res = wp_remote_request($this->redirection_script . '?code=302&rt=' . 5, array('redirection' => 0) ); 82 $this->assert False( is_wp_error($res));82 $this->assertNotWPError( $res ); 83 83 $this->assertEquals(302, (int)$res['response']['code'] ); 84 84 } … … 87 87 // 5 - 5 88 88 $res = wp_remote_request($this->redirection_script . '?rt=' . 5, array('redirection' => 5) ); 89 $this->assert False( is_wp_error($res));89 $this->assertNotWPError( $res ); 90 90 $this->assertEquals(200, (int)$res['response']['code'] ); 91 91 } … … 94 94 // No redirections on HEAD request: 95 95 $res = wp_remote_request($this->redirection_script . '?code=302&rt=' . 1, array('method' => 'HEAD') ); 96 $this->assert False( is_wp_error($res));96 $this->assertNotWPError( $res ); 97 97 $this->assertEquals( 302, (int)$res['response']['code'] ); 98 98 } … … 104 104 // Redirections on HEAD request when Requested 105 105 $res = wp_remote_request($this->redirection_script . '?rt=' . 5, array('redirection' => 5, 'method' => 'HEAD') ); 106 $this->assert False( is_wp_error($res));106 $this->assertNotWPError( $res ); 107 107 $this->assertEquals( 200, (int)$res['response']['code'] ); 108 108 } … … 123 123 // 4 < 5 (close edgecase) 124 124 $res = wp_remote_request($this->redirection_script . '?rt=' . 4, array('redirection' => 5) ); 125 $this->assert False( is_wp_error($res));125 $this->assertNotWPError( $res ); 126 126 } 127 127 … … 132 132 // 0 redirections asked for, Should return the document? 133 133 $res = wp_remote_request($this->redirection_script . '?code=302&rt=' . 5, array('redirection' => 0) ); 134 $this->assert False( is_wp_error($res));134 $this->assertNotWPError( $res ); 135 135 $this->assertEquals( 302, (int)$res['response']['code'] ); 136 136 } … … 144 144 // Prints PASS on initial load, FAIL if the client follows the specified redirection 145 145 $res = wp_remote_request( $this->redirection_script . '?201-location=true' ); 146 $this->assert False( is_wp_error( $res ));146 $this->assertNotWPError( $res ); 147 147 $this->assertEquals( 'PASS', $res['body']); 148 148 } … … 170 170 $res = wp_remote_request( $this->redirection_script . '?header-check', array('headers' => $headers) ); 171 171 172 $this->assert False( is_wp_error($res));172 $this->assertNotWPError( $res ); 173 173 174 174 $headers = array(); … … 199 199 } 200 200 201 $this->assert False( is_wp_error( $res ));201 $this->assertNotWPError( $res ); 202 202 $this->assertEquals( '', $res['body'] ); // The body should be empty. 203 203 $this->assertEquals( $size, $res['headers']['content-length'] ); // Check the headers are returned (and the size is the same..) … … 220 220 } 221 221 222 $this->assert False( is_wp_error( $res ));222 $this->assertNotWPError( $res ); 223 223 $this->assertEquals( $size, $filesize ); // Check that the file is written to disk correctly without any extra characters 224 224 … … 236 236 $res = wp_remote_request( $url, array( 'timeout' => 30, 'limit_response_size' => $size ) ); 237 237 238 $this->assert False( is_wp_error( $res ));238 $this->assertNotWPError( $res ); 239 239 $this->assertEquals( $size, strlen( $res['body'] ) ); 240 240 } -
trunk/tests/phpunit/tests/term.php
r34627 r34646 412 412 $t = wp_insert_category( array( 'cat_name' => $term ) ); 413 413 $this->assertTrue( is_numeric($t) ); 414 $this->assert False( is_wp_error($t));414 $this->assertNotWPError( $t ); 415 415 $this->assertTrue( $t > 0 ); 416 416 $this->assertEquals( $initial_count + 1, wp_count_terms( 'category' ) ); -
trunk/tests/phpunit/tests/term/wpInsertTerm.php
r31812 r34646 28 28 $t = wp_insert_term( $term, $taxonomy ); 29 29 $this->assertInternalType( 'array', $t ); 30 $this->assert False( is_wp_error($t));30 $this->assertNotWPError( $t ); 31 31 $this->assertTrue( $t['term_id'] > 0 ); 32 32 $this->assertTrue( $t['term_taxonomy_id'] > 0 ); … … 162 162 public function test_wp_insert_term_duplicate_name() { 163 163 $term = $this->factory->tag->create_and_get( array( 'name' => 'Bozo' ) ); 164 $this->assert False( is_wp_error( $term ));164 $this->assertNotWPError( $term ); 165 165 $this->assertTrue( empty( $term->errors ) ); 166 166 167 167 // Test existing term name with unique slug 168 168 $term1 = $this->factory->tag->create( array( 'name' => 'Bozo', 'slug' => 'bozo1' ) ); 169 $this->assert False( is_wp_error( $term1 ));169 $this->assertNotWPError( $term1 ); 170 170 171 171 // Test an existing term name … … 201 201 202 202 $term13 = $this->factory->tag->create( array( 'name' => 'A' ) ); 203 $this->assert False( is_wp_error( $term13 ));203 $this->assertNotWPError( $term13 ); 204 204 $term14 = $this->factory->tag->create( array( 'name' => 'A' ) ); 205 205 $this->assertTrue( is_wp_error( $term14 ) ); 206 206 $term15 = $this->factory->tag->create( array( 'name' => 'A+', 'slug' => 'a' ) ); 207 $this->assert False( is_wp_error( $term15 ));207 $this->assertNotWPError( $term15 ); 208 208 $term16 = $this->factory->tag->create( array( 'name' => 'A+' ) ); 209 209 $this->assertTrue( is_wp_error( $term16 ) ); 210 210 $term17 = $this->factory->tag->create( array( 'name' => 'A++' ) ); 211 $this->assert False( is_wp_error( $term17 ));211 $this->assertNotWPError( $term17 ); 212 212 $term18 = $this->factory->tag->create( array( 'name' => 'A-', 'slug' => 'a' ) ); 213 $this->assert False( is_wp_error( $term18 ));213 $this->assertNotWPError( $term18 ); 214 214 $term19 = $this->factory->tag->create( array( 'name' => 'A-' ) ); 215 215 $this->assertTrue( is_wp_error( $term19 ) ); 216 216 $term20 = $this->factory->tag->create( array( 'name' => 'A--' ) ); 217 $this->assert False( is_wp_error( $term20 ));217 $this->assertNotWPError( $term20 ); 218 218 } 219 219 … … 277 277 ) ); 278 278 279 $this->assert False( is_wp_error( $t2 ));279 $this->assertNotWPError( $t2 ); 280 280 281 281 $t2_term = get_term( $t2['term_id'], 'wptests_tax' ); … … 369 369 ) ); 370 370 371 $this->assert False( is_wp_error( $t4 ));371 $this->assertNotWPError( $t4 ); 372 372 $t4_term = get_term( $t4['term_id'], 'wptests_tax' ); 373 373 … … 392 392 ) ); 393 393 394 $this->assert False( is_wp_error( $t2 ));394 $this->assertNotWPError( $t2 ); 395 395 396 396 $t2_term = get_term( $t2['term_id'], 'wptests_tax' ); … … 456 456 ) ); 457 457 458 $this->assert False( is_wp_error( $created ));458 $this->assertNotWPError( $created ); 459 459 460 460 $new_term = get_term( $created['term_id'], 'wptests_tax_2' ); … … 487 487 ) ); 488 488 489 $this->assert False( is_wp_error( $created ));489 $this->assertNotWPError( $created ); 490 490 491 491 $new_term = get_term( $created['term_id'], 'wptests_tax_2' ); -
trunk/tests/phpunit/tests/term/wpUpdateTerm.php
r33652 r34646 189 189 ) ); 190 190 191 $this->assert False( is_wp_error( $updated ));191 $this->assertNotWPError( $updated ); 192 192 193 193 $t1_term = get_term( $t1, 'wptests_tax' ); … … 219 219 ) ); 220 220 221 $this->assert False( is_wp_error( $updated ));221 $this->assertNotWPError( $updated ); 222 222 223 223 $t2_term = get_term( $t2, 'wptests_tax_2' ); … … 257 257 ) ); 258 258 259 $this->assert False( is_wp_error( $updated ));259 $this->assertNotWPError( $updated ); 260 260 261 261 $t3_term = get_term( $t3, 'wptests_tax' );
Note: See TracChangeset
for help on using the changeset viewer.