public function testResolve() { $this->profiler->start('foo', 'barbar'); $this->profiler->stop('foo'); $this->profiler->monitor('Foobar', function () { // yeah }); $this->assertInstanceOf(\Generator::class, $this->datasource->getProcess($this->process->getId())); }
public function testResolveMonolog() { $monolog = new Monolog(); $log = new Logger('name'); $log->pushHandler($monolog); $monolog->setDispatcher($this->process->getDispatcher()); $this->profiler->setLogger($monolog); $log->addError('Bar'); $this->profiler->alert('FooBar'); $this->assertInstanceOf(\Generator::class, $this->datasource->getProcess($this->process->getId())); }
public function testPersist() { $this->collector->resolve(); $this->collector->persist(); $this->assertInstanceOf(\Generator::class, $this->datasource->getProcess($this->process->getId())); }
/** * @param Process $process * @param array $item * @return mixed * @throws IOException */ public function saveSummary(Process $process, array $item) { $fileName = $this->getProcessFolder($process->getId()) . DIRECTORY_SEPARATOR . self::SUMMARY_FILENAME; if ($this->filesystem->exists($fileName)) { $content = json_decode(file_get_contents($fileName)); if (is_bool($content)) { $content = []; } $item = array_merge((array) $content, $item); } return file_put_contents($fileName, json_encode($item)) !== false; }
protected function initiateMemoryProcess(Process $process) { if (!array_key_exists($process->getId(), $this->memory)) { $this->memory[$process->getId()] = []; } }