/** * {@inheritdoc} */ public function get($channel) { if (!isset($this->channels[$channel])) { $instance = new LoggerChannel($channel); // Pass the loggers to the channel. $instance->setLoggers($this->loggers); $this->channels[$channel] = $instance; } return $this->channels[$channel]; }
/** * @covers ::setCurrentUser() */ public function test_setCurrentUser() { $current_user = \Mockery::mock('alias:Drupal\\Core\\Session\\AccountInterface'); $this->loggerChannel->setCurrentUser($current_user); $this->assertAttributeEquals($current_user, 'currentUser', $this->loggerChannel); }