Exemplo n.º 1
0
 /**
  * @test
  * @dataProvider getLoggerCreatesValidIndexOfLoggersAndReturnsLoggerWithCorrectComponentNameDataProvider
  *
  * @param array $loggerNames
  * @param array $loggerConfiguration
  * @param array $expectedLoggerIndexKeys
  */
 public function getLoggerCreatesValidIndexOfLoggersAndReturnsLoggerWithCorrectComponentName($loggerNames, $loggerConfiguration, $expectedLoggerIndexKeys)
 {
     $this->proxy->_set('loggerConfiguration', $loggerConfiguration);
     foreach ($loggerNames as $loggerName) {
         $logger = $this->proxy->getLogger($loggerName);
     }
     $actualLoggerIndexKeys = $this->proxy->getLoggerNames();
     $this->assertSame($expectedLoggerIndexKeys, $actualLoggerIndexKeys, 'Expected and actual logger index keys are not equal');
 }
Exemplo n.º 2
0
 /**
  * @param array $data
  * @param string $component
  * @return \Tx_PtExtbase_Logger_Logger
  */
 public function enrichLogDataByComponent(&$data, $component)
 {
     if (!empty($GLOBALS['TSFE']->fe_user->user['uid'])) {
         $data['UserID'] = $GLOBALS['TSFE']->fe_user->user['uid'];
     }
     $this->enrichLoggerSpecificDataByComponent($data, $component);
     if (empty($component)) {
         $data['loggerComponent'] = $this->loggerManager->unifyComponentName($this->defaultLogComponent);
     } else {
         $data['loggerComponent'] = $this->loggerManager->unifyComponentName($component);
     }
     return $this;
 }