function PerformanceTestTrait::assertCountBetween

Same name in other branches
  1. 10 core/tests/Drupal/Tests/PerformanceTestTrait.php \Drupal\Tests\PerformanceTestTrait::assertCountBetween()

Asserts that a count is between a min and max inclusively.

Parameters

int $min: Minimum value.

int $max: Maximum value.

int $actual: The number to assert against.

Return value

void

Throws

\PHPUnit\Framework\ExpectationFailedException

2 calls to PerformanceTestTrait::assertCountBetween()
OpenTelemetryNodePagePerformanceTest::testNodePageHotCache in core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php
Logs node page tracing data with a hot cache.
StandardPerformanceTest::testAnonymous in core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
Tests performance for anonymous users.

File

core/tests/Drupal/Tests/PerformanceTestTrait.php, line 598

Class

PerformanceTestTrait
Provides various methods to aid in collecting performance data during tests.

Namespace

Drupal\Tests

Code

protected function assertCountBetween(int $min, int $max, int $actual) {
    static::assertThat($actual, static::logicalAnd(static::greaterThanOrEqual($min), static::lessThanOrEqual($max)), "{$actual} is greater or equal to {$min} and is smaller or equal to {$max}");
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.