Skip to content

Commit

Permalink
Merge c05a014 into d906154
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm committed Jun 18, 2019
2 parents d906154 + c05a014 commit e4fcf61
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/CosyLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function setLogger($logger)
*/
public function emergency($message, array $context = array())
{
// TODO: Implement emergency() method.
$this->logger->emergency($message, $context);
}

/**
Expand All @@ -46,7 +46,7 @@ public function emergency($message, array $context = array())
*/
public function alert($message, array $context = array())
{
// TODO: Implement alert() method.
$this->logger->alert($message, $context);
}

/**
Expand All @@ -61,7 +61,7 @@ public function alert($message, array $context = array())
*/
public function critical($message, array $context = array())
{
// TODO: Implement critical() method.
$this->logger->critical($message, $context);
}

/**
Expand All @@ -75,7 +75,7 @@ public function critical($message, array $context = array())
*/
public function error($message, array $context = array())
{
// TODO: Implement error() method.
$this->logger->error($message, $context);
}

/**
Expand All @@ -91,7 +91,7 @@ public function error($message, array $context = array())
*/
public function warning($message, array $context = array())
{
// TODO: Implement warning() method.
$this->logger->warning($message, $context);
}

/**
Expand All @@ -104,7 +104,7 @@ public function warning($message, array $context = array())
*/
public function notice($message, array $context = array())
{
// TODO: Implement notice() method.
$this->logger->notice($message, $context);
}

/**
Expand Down Expand Up @@ -132,7 +132,7 @@ public function info($message, array $context = array())
*/
public function debug($message, array $context = array())
{
// TODO: Implement debug() method.
$this->logger->debug($message, $context);
}

/**
Expand Down
30 changes: 30 additions & 0 deletions test/unit/CosyLoggerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace eiriksm\CosyComposerTest\unit;

use eiriksm\CosyComposer\CosyLogger;
use PHPUnit\Framework\TestCase;
use Psr\Log\LogLevel;
use Wa72\SimpleLogger\ArrayLogger;

class CosyLoggerTest extends TestCase
{
public function testMethods()
{
$logger = new CosyLogger();
$outer_logger = new ArrayLogger();
$logger->setLogger($outer_logger);
$logger->emergency('This is emergency');
$logger->alert('This is alert');
$logger->critical('This is critical');
$logger->error('This is error');
$logger->warning('This is warning');
$logger->notice('This is notice');
$logger->info('This is info');
$logger->debug('This is debug');
$messages = $outer_logger->get();
$this->assertEquals(8, count($messages));
$this->assertEquals($messages[0]["level"], LogLevel::EMERGENCY);
$this->assertEquals($messages[4]["level"], LogLevel::WARNING);
}
}

0 comments on commit e4fcf61

Please sign in to comment.