You are here

protected function QueueTest::queueScore in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Queue/QueueTest.php \Drupal\system\Tests\Queue\QueueTest::queueScore()

Returns the number of equal items in two arrays.

1 call to QueueTest::queueScore()
QueueTest::queueTest in core/modules/system/src/Tests/Queue/QueueTest.php
Queues and dequeues a set of items to check the basic queue functionality.

File

core/modules/system/src/Tests/Queue/QueueTest.php, line 121
Contains \Drupal\system\Tests\Queue\QueueTest.

Class

QueueTest
Queues and dequeues a set of items to check the basic queue functionality.

Namespace

Drupal\system\Tests\Queue

Code

protected function queueScore($items, $new_items) {
  $score = 0;
  foreach ($items as $item) {
    foreach ($new_items as $new_item) {
      if ($item === $new_item) {
        $score++;
      }
    }
  }
  return $score;
}