Ejemplo n.º 1
0
 public function testThatProfilerCanRegisterModules()
 {
     $p = new Profiler(new Repo());
     $p->setDefaultModules(['FirstDummyModule', 'SecondDummyModule']);
     $a = new Application();
     $c = M::mock('Illuminate\\Config\\Repository');
     $c->shouldReceive('get')->once()->andReturn([]);
     $a->instance('config', $c);
     $p->registerModules($a);
 }
Ejemplo n.º 2
0
 /**
  * Hydrate modules with data from storage record.
  *
  * @param  Storage $storage
  * @return void
  */
 public function hydrate(Storage $storage)
 {
     // Extract the module data from storage.
     $modules = $storage->getData();
     // Iterate module data.
     foreach ($modules as $slug => $module) {
         // Get live module from profiler.
         $m = $this->profiler->getModule($slug);
         // Set module data from storage.
         $m->setData(array_get($module, 'data'));
         $m->setGlobal(array_get($module, 'global'));
         $m->setBadge(array_get($module, 'badge'));
     }
 }
Ejemplo n.º 3
0
 /**
  * Execute the filter to disable anbu.
  *
  * @return void
  */
 public function disable()
 {
     $this->profiler->disable();
 }