You are here

public function LengthIndicatorTest::testLengthIndicatorGetWidthAndPos in Length Indicator 8

Tests _length_indicator_get_width_and_pos().

@dataProvider providerTestLengthIndicatorGetWidthAndPos

File

tests/src/Unit/LengthIndicatorTest.php, line 33

Class

LengthIndicatorTest
Tests the code in length_indicator.module.

Namespace

Drupal\Tests\length_indicator\Unit

Code

public function testLengthIndicatorGetWidthAndPos($optimin, $optimax, $tolerance, array $expected) {
  $service_length_indicator = new GetWidthPos();
  $this
    ->assertEquals($expected, $service_length_indicator
    ->getWidthAndPosition($optimin, $optimax, $tolerance));
}