mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-12 08:04:02 +02:00
Store user in a temporary property instead of hacking it into the record
This commit is contained in:
@@ -82,7 +82,7 @@ class PushoverHandlerTest extends TestCase
|
||||
$this->assertRegexp('/message=' . $expectedMessage . '&title/', $content);
|
||||
}
|
||||
|
||||
public function testWriteWithHighPriority()
|
||||
public function testWriteWithHighPriority()
|
||||
{
|
||||
$this->createHandler();
|
||||
$this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
|
||||
@@ -92,7 +92,7 @@ class PushoverHandlerTest extends TestCase
|
||||
$this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog×tamp=\d{10}&priority=1$/', $content);
|
||||
}
|
||||
|
||||
public function testWriteWithEmergencyPriority()
|
||||
public function testWriteWithEmergencyPriority()
|
||||
{
|
||||
$this->createHandler();
|
||||
$this->handler->handle($this->getRecord(Logger::EMERGENCY, 'test1'));
|
||||
@@ -102,6 +102,17 @@ class PushoverHandlerTest extends TestCase
|
||||
$this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog×tamp=\d{10}&priority=2$/', $content);
|
||||
}
|
||||
|
||||
public function testWriteToMultipleUsers()
|
||||
{
|
||||
$this->createHandler('myToken', array('userA', 'userB'));
|
||||
$this->handler->handle($this->getRecord(Logger::EMERGENCY, 'test1'));
|
||||
fseek($this->res, 0);
|
||||
$content = fread($this->res, 1024);
|
||||
|
||||
$this->assertRegexp('/token=myToken&user=userA&message=test1&title=Monolog×tamp=\d{10}&priority=2POST/', $content);
|
||||
$this->assertRegexp('/token=myToken&user=userB&message=test1&title=Monolog×tamp=\d{10}&priority=2$/', $content);
|
||||
}
|
||||
|
||||
private function createHandler($token = 'myToken', $user = 'myUser', $title = 'Monolog')
|
||||
{
|
||||
$constructorArgs = array($token, $user, $title);
|
||||
|
Reference in New Issue
Block a user