You are here

public function WebformArrayHelperTest::testInArray in Webform 8.5

Same name and namespace in other branches
  1. 6.x tests/src/Unit/Utility/WebformArrayHelperTest.php \Drupal\Tests\webform\Unit\Utility\WebformArrayHelperTest::testInArray()

Tests determining type of array with WebformArrayHelper::InArray().

@dataProvider providerInArray

Parameters

array $needles: The searched values.

array $haystack: The array.

string $expected: The expected result from calling the function.

See also

WebformArrayHelper::InArray()

File

tests/src/Unit/Utility/WebformArrayHelperTest.php, line 97

Class

WebformArrayHelperTest
Tests webform array utility.

Namespace

Drupal\Tests\webform\Unit\Utility

Code

public function testInArray(array $needles, array $haystack, $expected) {
  $result = WebformArrayHelper::InArray($needles, $haystack);
  $this
    ->assertEquals($expected, $result);
}