Exemple #1
0
 public function initiate()
 {
     parent::initiate();
     $processId = $this->request->headers->get(self::HEADER_PROCESS, null);
     $this->process = Process::build($processId);
     $this->process->setContext($this);
 }
Exemple #2
0
 protected function setUp()
 {
     parent::setUp();
     $this->datasource = new Memory();
     $this->process = Process::build();
     $this->collector = new Config($this->process, $this->datasource);
 }
Exemple #3
0
 public function initiate()
 {
     parent::initiate();
     $this->process = Process::build();
     $this->process->setContext($this);
     $this->sendDebugIds();
 }
Exemple #4
0
 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());
 }
Exemple #5
0
 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);
 }
Exemple #6
0
 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();
 }
Exemple #8
0
 /**
  * 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());
 }