Skip to content

Commit 00f1c96

Browse files
committed
Tests: Use assertWPError() in Customizer setting tests.
Use the dedicated assertion helper for expected `WP_Error` results, preserving the existing test behavior and assertion messages. Developed in: #14568 Props shailu25. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@64649 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 0e1f633 commit 00f1c96

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎tests/phpunit/tests/customize/setting.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ public function test_validate() {
729729
)
730730
);
731731
$validity = $setting->validate( 'BAD!' );
732-
$this->assertInstanceOf( 'WP_Error', $validity );
732+
$this->assertWPError( $validity );
733733
$this->assertSame( 'invalid_key', $validity->get_error_code() );
734734
}
735735

@@ -743,7 +743,7 @@ public function test_validate() {
743743
* @return WP_Error
744744
*/
745745
public function filter_validate_for_test_validate( $validity, $value ) {
746-
$this->assertInstanceOf( 'WP_Error', $validity );
746+
$this->assertWPError( $validity );
747747
$this->assertIsString( $value );
748748
if ( sanitize_key( $value ) !== $value ) {
749749
$validity->add( 'invalid_key', 'Invalid key' );

0 commit comments

Comments
 (0)