Make WordPress Core


Ignore:
Timestamp:
07/07/2021 10:32:56 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use more appropriate assertions in various tests.

This replaces instances of assertSame( [number], count( ... ) ) with assertCount() to use native PHPUnit functionality.

Follow-up to [51335], [51337].

See #53363.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/feed/rss2.php

    r50337 r51367  
    107107
    108108                // There should only be one <rss> child element.
    109                 $this->assertSame( 1, count( $rss ) );
     109                $this->assertCount( 1, $rss );
    110110
    111111                $this->assertSame( '2.0', $rss[0]['attributes']['version'] );
    … …  
    115115
    116116                // RSS should have exactly one child element (channel).
    117                 $this->assertSame( 1, count( $rss[0]['child'] ) );
     117                $this->assertCount( 1, $rss[0]['child'] );
    118118        }
    119119
    … …  
    321321
    322322                // There should only be one <rss> child element.
    323                 $this->assertSame( 1, count( $rss ) );
     323                $this->assertCount( 1, $rss );
    324324        }
    325325
    … …  
    349349
    350350                // There should only be one <rss> child element.
    351                 $this->assertSame( 1, count( $rss ) );
     351                $this->assertCount( 1, $rss );
    352352        }
    353353
    … …  
    382382
    383383                // There should only be one <rss> child element.
    384                 $this->assertSame( 1, count( $rss ) );
     384                $this->assertCount( 1, $rss );
    385385        }
    386386
    … …  
    410410
    411411                // There should only be one <rss> child element.
    412                 $this->assertSame( 1, count( $rss ) );
     412                $this->assertCount( 1, $rss );
    413413        }
    414414
    … …  
    438438
    439439                // There should only be one <rss> child element.
    440                 $this->assertSame( 1, count( $rss ) );
     440                $this->assertCount( 1, $rss );
    441441        }
    442442
    … …  
    466466
    467467                // There should only be one <rss> child element.
    468                 $this->assertSame( 1, count( $rss ) );
     468                $this->assertCount( 1, $rss );
    469469        }
    470470
Note: See TracChangeset for help on using the changeset viewer.