You are here

public function PercentagesTest::testPercentages in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Batch/PercentagesTest.php \Drupal\Tests\Core\Batch\PercentagesTest::testPercentages()

@dataProvider providerTestPercentages @covers ::format

File

core/tests/Drupal/Tests/Core/Batch/PercentagesTest.php, line 27
Contains \Drupal\Tests\Core\Batch\PercentagesTest.

Class

PercentagesTest
@coversDefaultClass \Drupal\Core\Batch\Percentage @group Batch

Namespace

Drupal\Tests\Core\Batch

Code

public function testPercentages($total, $current, $expected_result) {
  $actual_result = Percentage::format($total, $current);
  $this
    ->assertEquals($actual_result, $expected_result, sprintf('The expected the batch api percentage at the state %s/%s is %s%% and got %s%%.', $current, $total, $expected_result, $actual_result));
}