Changeset 53538
- Timestamp:
- 06/20/2022 09:35:03 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/functions.php
r53537 r53538 485 485 /** 486 486 * @ticket 55403 487 * @covers ::wp_crop_image 487 488 */ 488 489 public function test_wp_crop_image_with_filtered_extension() { … … 509 510 510 511 /** 512 * @covers ::wp_crop_image 511 513 * @requires function imagejpeg 512 514 */ … … 521 523 100 522 524 ); 523 $this->assertNotWPError( $file ); 524 $this->assertFileExists( $file ); 525 $this->assertNotWPError( $file, 'Cropping the image resulted in a WP_Error.' ); 526 $this->assertFileExists( $file, "The file $file does not exist." ); 527 525 528 $image = wp_get_image_editor( $file ); 526 529 $size = $image->get_size(); 527 $this->assertSame( 100, $size['height'] ); 528 $this->assertSame( 100, $size['width'] ); 530 531 $this->assertSame( 100, $size['height'], 'Cropped image height does not match expectation.' ); 532 $this->assertSame( 100, $size['width'], 'Cropped image width does not match expectation.' ); 529 533 530 534 unlink( $file ); … … 532 536 533 537 /** 538 * @covers ::wp_crop_image 534 539 * @requires function imagejpeg 535 540 * @requires extension openssl … … 552 557 } 553 558 554 $this->assertNotWPError( $file ); 555 $this->assertFileExists( $file ); 559 $this->assertNotWPError( $file, 'Cropping the image resulted in a WP_Error.' ); 560 $this->assertFileExists( $file, "The file $file does not exist." ); 561 556 562 $image = wp_get_image_editor( $file ); 557 563 $size = $image->get_size(); 558 $this->assertSame( 100, $size['height'] ); 559 $this->assertSame( 100, $size['width'] ); 564 565 $this->assertSame( 100, $size['height'], 'Cropped image height does not match expectation.' ); 566 $this->assertSame( 100, $size['width'], 'Cropped image width does not match expectation.' ); 560 567 561 568 unlink( $file ); 562 569 } 563 570 564 public function test_wp_crop_image_file_not_exist() { 571 /** 572 * @covers ::wp_crop_image 573 */ 574 public function test_wp_crop_image_file_not_exists() { 565 575 $file = wp_crop_image( 566 576 DIR_TESTDATA . '/images/canoladoesnotexist.jpg', … … 576 586 577 587 /** 588 * @covers ::wp_crop_image 578 589 * @requires extension openssl 579 590 */ 580 public function test_wp_crop_image_url_not_exist () {591 public function test_wp_crop_image_url_not_exists() { 581 592 $file = wp_crop_image( 582 593 'https://asdftestblog1.files.wordpress.com/2008/04/canoladoesnotexist.jpg', … … 593 604 /** 594 605 * @ticket 23325 606 * @covers ::wp_crop_image 595 607 */ 596 608 public function test_wp_crop_image_error_on_saving() {
Note: See TracChangeset
for help on using the changeset viewer.