1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-10 15:14:14 +02:00

Added @covers annotations to everything

This commit is contained in:
Jordi Boggiano
2011-06-29 20:23:08 +02:00
parent 61d5a23e41
commit 8108272c6c
9 changed files with 116 additions and 6 deletions

View File

@@ -16,6 +16,19 @@ use Monolog\Logger;
class GroupHandlerTest extends TestCase
{
/**
* @covers Monolog\Handler\GroupHandler::__construct
* @expectedException InvalidArgumentException
*/
public function testConstructorOnlyTakesHandler()
{
new GroupHandler(array(new TestHandler(), "foo"));
}
/**
* @covers Monolog\Handler\GroupHandler::__construct
* @covers Monolog\Handler\GroupHandler::handle
*/
public function testHandle()
{
$testHandlers = array(new TestHandler(), new TestHandler());
@@ -29,6 +42,9 @@ class GroupHandlerTest extends TestCase
}
}
/**
* @covers Monolog\Handler\GroupHandler::handleBatch
*/
public function testHandleBatch()
{
$testHandlers = array(new TestHandler(), new TestHandler());
@@ -40,4 +56,16 @@ class GroupHandlerTest extends TestCase
$this->assertTrue(count($test->getRecords()) === 2);
}
}
/**
* @covers Monolog\Handler\GroupHandler::isHandling
*/
public function testIsHandling()
{
$testHandlers = array(new TestHandler(Logger::ERROR), new TestHandler(Logger::WARNING));
$handler = new GroupHandler($testHandlers);
$this->assertTrue($handler->isHandling($this->getRecord(Logger::ERROR)));
$this->assertTrue($handler->isHandling($this->getRecord(Logger::WARNING)));
$this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG)));
}
}