public function testGetProcess() { $profile = $this->datasource->getProcess('XXX'); $this->assertInstanceOf(\Generator::class, $profile); $array = iterator_to_array($profile); $this->assertCount(1, $array); }
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 testSave() { $process = Process::build(); $this->datasource->save($process, ['foo' => 'bar']); $this->assertEquals(1, $this->datasource->count()); $profile = $this->datasource->getProcess($process->getId()); $this->assertInstanceOf(\Generator::class, $profile); $profile = json_decode(current(iterator_to_array($profile))); $this->assertInstanceOf(\stdClass::class, $profile); $this->assertObjectHasAttribute('foo', $profile); $this->assertEquals('bar', $profile->foo); }
public function testPersist() { $this->collector->resolve(); $this->collector->persist(); $this->assertInstanceOf(\Generator::class, $this->datasource->getProcess($this->process->getId())); }
/** * @param $id * @return mixed */ public function getProfile($id) { return (new JsonPatch())->compile($this->datasource->getProcess($id)); }