コード例 #1
0
 public function testStatusOfDefaultConfiguration()
 {
     $dist = (require __DIR__ . "/../config/zenddevelopertools.local.php.dist");
     $reportMock = $this->getMock("ZendDeveloperTools\\ReportInterface");
     $options = new Options($dist['zenddevelopertools'], $reportMock);
     $this->assertTrue($options->isEnabled());
     $this->assertTrue($options->isToolbarEnabled());
 }
コード例 #2
0
 /**
  * Registers listeners if enabled.
  *
  * @return self
  */
 public function init()
 {
     if ($this->options->isEnabled()) {
         if ($this->options->canFlushEarly()) {
             $this->eventManager->attachAggregate($this->serviceLocator->get('ZDT_FlushListener'));
         }
         if ($this->options->isStrict() && $this->report->hasErrors()) {
             throw new Exception\InvalidOptionException(implode(' ', $this->report->getErrors()));
         }
         $this->eventManager->attachAggregate($this->serviceLocator->get('ZDT_ProfileListener'));
         $this->registerVerbose()->registerToolbar();
         if ($this->options->isStrict() && $this->report->hasErrors()) {
             throw new Exception\ProfilerException(implode(' ', $this->report->getErrors()));
         }
     }
     return $this;
 }