Make WordPress Core


Ignore:
Timestamp:
07/10/2021 11:15:44 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use more appropriate assertions in various tests.

This replaces instances of assertTrue( isset( ... ) ) with assertArrayHasKey() to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367].

See #53363.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/taxonomy.php

    r51367 r51397  
    843843        $this->assertIsArray( $wp_rewrite->extra_permastructs['foo'] );
    844844        $this->assertTrue( unregister_taxonomy( 'foo' ) );
    845         $this->assertFalse( isset( $wp_rewrite->extra_permastructs['foo'] ) );
     845        $this->assertArrayNotHasKey( 'foo', $wp_rewrite->extra_permastructs );
    846846    }
    847847
     
    879879        $this->assertTrue( unregister_taxonomy( 'foo' ) );
    880880
    881         $this->assertFalse( isset( $wp_taxonomies['foo'] ) );
     881        $this->assertArrayNotHasKey( 'foo', $wp_taxonomies );
    882882        $this->assertFalse( get_taxonomy( 'foo' ) );
    883883    }
Note: See TracChangeset for help on using the changeset viewer.