function NumberTest::testConversions

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/NumberTest.php \Drupal\Tests\Component\Utility\NumberTest::testConversions()
  2. 8.9.x core/tests/Drupal/Tests/Component/Utility/NumberTest.php \Drupal\Tests\Component\Utility\NumberTest::testConversions()
  3. 10 core/tests/Drupal/Tests/Component/Utility/NumberTest.php \Drupal\Tests\Component\Utility\NumberTest::testConversions()

Tests the alphadecimal conversion functions.

@dataProvider providerTestConversions @covers ::intToAlphadecimal @covers ::alphadecimalToInt

Parameters

int $value: The integer value.

string $expected: The expected alphadecimal value.

File

core/tests/Drupal/Tests/Component/Utility/NumberTest.php, line 133

Class

NumberTest
Tests number manipulation utilities.

Namespace

Drupal\Tests\Component\Utility

Code

public function testConversions($value, $expected) : void {
    $this->assertSame(Number::intToAlphadecimal($value), $expected);
    $this->assertSame($value, Number::alphadecimalToInt($expected));
}

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