You are here

protected function UCXFApiTestCase::arrayMatch in Extra Fields Checkout Pane 7

Same name and namespace in other branches
  1. 6.2 uc_extra_fields_pane.test \UCXFApiTestCase::arrayMatch()

Checks how many elements from $array2 appear in $array1.

Parameters

array $array1:

array $array2:

2 calls to UCXFApiTestCase::arrayMatch()
UCXFApiTestCase::testUCXF_FieldList in ./uc_extra_fields_pane.test
Test if UCXF_FieldList behaves as excepted.
UCXFApiTestCase::testUCXF_Value in ./uc_extra_fields_pane.test
Test if UCXF_Value behaves as excepted.

File

./uc_extra_fields_pane.test, line 543
Automated tests for Extra Fields Pane

Class

UCXFApiTestCase
API Test

Code

protected function arrayMatch($array1, $array2) {
  $found = 0;
  foreach ($array1 as $element) {
    foreach ($array2 as $array2_element) {
      if ($element === $array2_element) {
        $found++;
      }
    }
  }
  return $found;
}