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/admin/includesPlugin.php

    r51335 r51397  
    3131
    3232        foreach ( $default_headers as $name => $value ) {
    33             $this->assertTrue( isset( $data[ $name ] ) );
     33            $this->assertArrayHasKey( $name, $data );
    3434            $this->assertSame( $value, $data[ $name ] );
    3535        }
     
    553553
    554554        $result = validate_active_plugins();
    555         $this->assertTrue( isset( $result[ $plugin[0] ] ) );
     555        $this->assertArrayHasKey( $plugin[0], $result );
    556556    }
    557557
Note: See TracChangeset for help on using the changeset viewer.