/** * @group AppKit */ public function testUniqueMultidimensional() { $test = array(array('row1_a', 'row1_b', 'row1_c'), array('row1_a', 'row1_b', 'row1_c'), array('row1_a', 'row1_b', 'row1_c'), array('row2_a', 'row2_b', 'row2_c'), array('row3_a', 'row3_b', 'row3_c'), array('row2_a', 'row2_b', 'row2_c'), array('row3_a', 'row3_b', 'row3_c'), array('row1_a', 'row1_b', 'row1_c')); $unique = array_values(AppKitArrayUtil::uniqueMultidimensional($test)); $this->assertCount(3, $unique); $this->assertEquals($unique[1], array('row2_a', 'row2_b', 'row2_c')); }
public function dispatchCommands() { $dispatcher = $this->getContext()->getModel("Commands.CommandDispatcher", "Api"); $this->context->getLoggerManager()->log(print_r($this->selection, 1)); $this->selection = AppKitArrayUtil::uniqueMultidimensional($this->selection); $this->context->getLoggerManager()->log(print_r($this->selection, 1)); AppKitLogger::debug("Trying to send commands, targets: %s , data: %s ", json_encode($this->selection), json_encode($this->data)); foreach ($this->selection as $target) { $console = $this->getConsoleInstance($target['instance']); $dispatcher->setConsoleContext($console); AppKitLogger::debug("Submitting command %s to %s", $this->command, json_encode($target)); $dispatcher->submitCommand($this->command, array_merge($target, $this->data)); AppKitLogger::debug("Finished submitting command"); } }