HosipLan

Untitled

Oct 9th, 2011
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1.     /**
  2.      * @param array $collection
  3.      * @param array $lists
  4.      * @param array $mappers
  5.      * @param boolean $allowDuplications
  6.      */
  7.     public function assertContainsCombinations($collection, array $lists, array $mappers, $allowDuplications = TRUE)
  8.     {
  9.         $mappers = array_map('callback', $mappers);
  10.         $this->assertSame(count($lists), count($mappers), "Count of given lists equals to count of given mappers");
  11.  
  12.         $found = array_fill_keys(range(0, count($mappers)), array());
  13.         foreach ($collection as $item) {
  14.             foreach ($mappers as $i => $mapper) {
  15.                 $found[$i][] = $mapper($item);
  16.             }
  17.         }
  18.  
  19.         $combinations = array();
  20.  
  21. //      $counts = array_map('array_count_values', $found);
  22. //      dump($counts);
  23.     }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment