Make WordPress Core


Ignore:
Timestamp:
07/10/2021 11:15:44 AM (3 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/rest-api/rest-taxonomies-controller.php

    r51367 r51397  
    267267            $this->assertSame( $tax_obj->show_ui, $data['visibility']['show_ui'] );
    268268        } else {
    269             $this->assertFalse( isset( $data['capabilities'] ) );
    270             $this->assertFalse( isset( $data['labels'] ) );
    271             $this->assertFalse( isset( $data['show_cloud'] ) );
    272             $this->assertFalse( isset( $data['visibility'] ) );
     269            $this->assertArrayNotHasKey( 'capabilities', $data );
     270            $this->assertArrayNotHasKey( 'labels', $data );
     271            $this->assertArrayNotHasKey( 'show_cloud', $data );
     272            $this->assertArrayNotHasKey( 'visibility', $data );
    273273        }
    274274    }
Note: See TracChangeset for help on using the changeset viewer.