function QueueTestCase::queueScore in Drupal 7
This function returns the number of equal items in two arrays.
1 call to QueueTestCase::queueScore()
- QueueTestCase::testQueue in modules/
system/ system.test - Queues and dequeues a set of items to check the basic queue functionality.
File
- modules/
system/ system.test, line 2123 - Tests for system.module.
Class
- QueueTestCase
- Test the basic queue functionality.
Code
function queueScore($items, $new_items) {
$score = 0;
foreach ($items as $item) {
foreach ($new_items as $new_item) {
if ($item === $new_item) {
$score++;
}
}
}
return $score;
}