mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-03 11:47:38 +02:00
Added logger name getter, Monolog\Logger::getName()
Added phpunit.xml to .gitignore to prevent contributors from accidentally commiting theirs.
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
phpunit.xml
|
@@ -92,6 +92,13 @@ class Logger
|
|||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getName() {
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pushes an handler on the stack.
|
* Pushes an handler on the stack.
|
||||||
*
|
*
|
||||||
|
@@ -16,6 +16,16 @@ use Monolog\Handler\TestHandler;
|
|||||||
|
|
||||||
class LoggerTest extends \PHPUnit_Framework_TestCase
|
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
|
* @covers Monolog\Logger::__construct
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user