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/blocks/block-list.php

    r51367 r51397  
    5252
    5353        // Test "offsetExists".
    54         $this->assertTrue( isset( $blocks[0] ) );
     54        $this->assertArrayHasKey( 0, $blocks );
    5555
    5656        // Test "offsetGet".
     
    6464        // Test "offsetUnset".
    6565        unset( $blocks[0] );
    66         $this->assertFalse( isset( $blocks[0] ) );
     66        $this->assertArrayNotHasKey( 0, $blocks );
    6767    }
    6868
Note: See TracChangeset for help on using the changeset viewer.