diff --git a/core/modules/system/lib/Drupal/system/Tests/Batch/PercentagesUnitTest.php b/core/tests/Drupal/Tests/Component/Batch/PercentagesUnitTest.php similarity index 84% rename from core/modules/system/lib/Drupal/system/Tests/Batch/PercentagesUnitTest.php rename to core/tests/Drupal/Tests/Component/Batch/PercentagesUnitTest.php index 5b92b19..d69cc62 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Batch/PercentagesUnitTest.php +++ b/core/tests/Drupal/Tests/Component/Batch/PercentagesUnitTest.php @@ -5,9 +5,9 @@ * Definition of Drupal\system\Tests\Batch\PercentagesUnitTest. */ -namespace Drupal\system\Tests\Batch; +namespace Drupal\Tests\Component\Batch; -use Drupal\simpletest\UnitTestBase; +use Drupal\Tests\UnitTestCase; /** * Unit tests of progress percentage rounding. @@ -15,7 +15,7 @@ * Tests the function _batch_api_percentage() to make sure that the rounding * works properly in all cases. */ -class PercentagesUnitTest extends UnitTestBase { +class PercentagesUnitTest extends UnitTestCase { protected $testCases = array(); public static function getInfo() { @@ -91,11 +91,8 @@ function testBatchPercentages() { $total = $arguments['total']; $current = $arguments['current']; $actual_result = _batch_api_percentage($total, $current); - if ($actual_result === $expected_result) { - $this->pass(format_string('Expected the batch api percentage at the state @numerator/@denominator to be @expected%, and got @actual%.', array('@numerator' => $current, '@denominator' => $total, '@expected' => $expected_result, '@actual' => $actual_result))); - } - else { - $this->fail(format_string('Expected the batch api percentage at the state @numerator/@denominator to be @expected%, but got @actual%.', array('@numerator' => $current, '@denominator' => $total, '@expected' => $expected_result, '@actual' => $actual_result))); + if ($actual_result !== $expected_result) { + $this->fail(sprintf('Expected the batch api percentage at the state %s/%s to be %s%%, but got %s%%.', $current, $total, $expected_result, $actual_result)); } } }