Skip to content

Commit

Permalink
Tests: replace assert[Not]InternalType( 'resource', $var ) with `as…
Browse files Browse the repository at this point in the history
…sertIs[Not]Resource()`

The `assertInternalType()` and `assertNotInternalType()` methods were soft deprecated in PHPUnit 7.5, hard deprecated in PHPUnit 8.0 and the functionality was removed in PHPUnit 9.0.

The more specific `assertIsArray()`, `assertIsNotArray()`, `assertIsBool()`, `assertIsNotBool()`, `assertIsFloat()`, `assertIsNotFloat()`, `assertIsInt()`, `assertIsNotInt()`, `assertIsNumeric()`, `assertIsNotNumeric()`, `assertIsObject()`, `assertIsNotObject()`, `assertIsResource()`, `assertIsNotResource()`, `assertIsString()`,
`assertIsNotString()`, `assertIsScalar()`, `assertIsNotScalar()`, `assertIsCallable()`, `assertIsNotCallable()`, `assertIsIterable()`, `assertIsNotIterable()` methods were introduced as replacements in PHPUnit 7.5.

Ref:
* https://github.com/sebastianbergmann/phpunit/blob/7.5.20/ChangeLog-7.5.md#750---2018-12-07
* sebastianbergmann/phpunit#3368
  • Loading branch information
jrfnl committed Aug 19, 2020
1 parent 725bd04 commit f746feb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/phpunit/tests/image/functions.php
Expand Up @@ -302,10 +302,10 @@ public function test_load_directory() {

// First, test with deprecated wp_load_image function.
$editor1 = wp_load_image( DIR_TESTDATA );
$this->assertNotInternalType( 'resource', $editor1 );
$this->assertIsNotResource( $editor1 );

$editor2 = wp_get_image_editor( DIR_TESTDATA );
$this->assertNotInternalType( 'resource', $editor2 );
$this->assertIsNotResource( $editor2 );

// Then, test with editors.
$classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
Expand Down

0 comments on commit f746feb

Please sign in to comment.