public function initiate() { parent::initiate(); $processId = $this->request->headers->get(self::HEADER_PROCESS, null); $this->process = Process::build($processId); $this->process->setContext($this); }
protected function setUp() { parent::setUp(); $this->datasource = new Memory(); $this->process = Process::build(); $this->collector = new Config($this->process, $this->datasource); }
public function initiate() { parent::initiate(); $this->process = Process::build(); $this->process->setContext($this); $this->sendDebugIds(); }
public function testBuildWithParentId() { $process = Process::build('foo'); $this->assertInstanceOf(Process::class, $process); $this->assertNotNull($process->getId()); $this->assertEquals('foo', $process->getParentId()); $this->assertInstanceOf(EventDispatcher::class, $process->getDispatcher()); }
public function testSaveSummary() { $process = Process::build(); $this->datasource->saveSummary($process, ['foo' => 'bar']); $profiles = $this->datasource->all(); $this->assertEquals(1, count($profiles)); $profile = current($profiles); $this->assertObjectHasAttribute('foo', $profile); $this->assertEquals('bar', $profile->foo); }
protected function setUp() { parent::setUp(); $this->datasource = new Memory(); $this->process = Process::build(); $this->collector = new User($this->process, $this->datasource); $user = new \stdClass(); $user->email = '*****@*****.**'; $user->id = 1; $user->phone = '+33123456789'; $this->collector->setUser($user); }
public function testRegisterCollectors() { $this->profiler->registerCollectors([new PhpVersion(Process::build(), new NullDataSource()), new Context(Process::build(), new NullDataSource())]); $this->profiler->initiate(); $this->profiler->terminate(); }
/** * NullContext constructor. */ public function __construct() { $this->process = Process::build(); }
public function testSaveSummary() { $process = Process::build(); $this->datasource->saveSummary($process, ['foo' => 'bar']); $this->assertEquals(0, $this->datasource->count()); }