private function createListener($result) { $multiListener = new MultiListener(); foreach ($this->configuration->getListeners() as $listener) { $multiListener->add($listener); } return $multiListener->add($result); }
function mergeFileAndArgument() { $this->files->givenTheFile_Containing('scrut.json', json_encode(['runner' => ReadConfiguration_TestRunner::class, 'listeners' => ['array' => ArrayListener::class], 'listen' => ['Fail', 'Memory']])); $this->whenIExecuteTheCommand(['-l' . ResultListener::class, '-c' . json_encode(['listen' => ['array']])]); $listeners = $this->config->getListeners(); $this->assert->size($listeners, 2); $this->assert->isInstanceOf($listeners[0], ResultListener::class); $this->assert->isInstanceOf($listeners[1], ArrayListener::class); }