Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @param array $collection
- * @param array $lists
- * @param array $mappers
- * @param boolean $allowDuplications
- */
- public function assertContainsCombinations($collection, array $lists, array $mappers, $allowDuplications = TRUE)
- {
- $mappers = array_map('callback', $mappers);
- $this->assertSame(count($lists), count($mappers), "Count of given lists equals to count of given mappers");
- $found = array_fill_keys(range(0, count($mappers)), array());
- foreach ($collection as $item) {
- foreach ($mappers as $i => $mapper) {
- $found[$i][] = $mapper($item);
- }
- }
- $combinations = array();
- // $counts = array_map('array_count_values', $found);
- // dump($counts);
- }
Advertisement
Add Comment
Please, Sign In to add comment