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/http/http.php

    r50537 r51397  
    314314        foreach ( array_keys( $cookies ) as $cookie ) {
    315315            if ( 'foo' === $cookie ) {
    316                 $this->assertFalse( isset( $cookie_jar[ $cookie ] ) );
     316                $this->assertArrayNotHasKey( $cookie, $cookie_jar );
    317317            } else {
    318318                $this->assertInstanceOf( 'Requests_Cookie', $cookie_jar[ $cookie ] );
Note: See TracChangeset for help on using the changeset viewer.