diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..57be4e31 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +phpunit.xml \ No newline at end of file diff --git a/src/Monolog/Logger.php b/src/Monolog/Logger.php index 47491a8c..860cab7c 100644 --- a/src/Monolog/Logger.php +++ b/src/Monolog/Logger.php @@ -92,6 +92,13 @@ class Logger $this->name = $name; } + /** + * @return string + */ + public function getName() { + return $this->name; + } + /** * Pushes an handler on the stack. * diff --git a/tests/Monolog/LoggerTest.php b/tests/Monolog/LoggerTest.php index 75b87d9f..e76bb7f7 100644 --- a/tests/Monolog/LoggerTest.php +++ b/tests/Monolog/LoggerTest.php @@ -16,6 +16,16 @@ use Monolog\Handler\TestHandler; class LoggerTest extends \PHPUnit_Framework_TestCase { + + /** + * @covers Monolog\Logger::getName() + */ + public function testGetName() + { + $logger = new Logger('foo'); + $this->assertEquals('foo', $logger->getName()); + } + /** * @covers Monolog\Logger::__construct */