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

    r48937 r51397  
    101101        $this->assertFalse( $dep->query( 'one', 'queue' ) );
    102102        $this->assertTrue( $dep->query( 'two', 'queue' ) );
    103         $this->assertFalse( isset( $dep->args['one'] ) );
     103        $this->assertArrayNotHasKey( 'one', $dep->args );
    104104
    105105        $dep->dequeue( 'two' );
    106106        $this->assertFalse( $dep->query( 'one', 'queue' ) );
    107107        $this->assertFalse( $dep->query( 'two', 'queue' ) );
    108         $this->assertFalse( isset( $dep->args['two'] ) );
     108        $this->assertArrayNotHasKey( 'two', $dep->args );
    109109    }
    110110
Note: See TracChangeset for help on using the changeset viewer.