mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-09 06:36:46 +02:00
Changing typo in variable name and default title for pushover message
This commit is contained in:
@@ -32,10 +32,10 @@ class PushoverHandler extends SocketHandler
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
*/
|
||||
public function __construct($token, $user, $title = 'Monolog error', $level = Logger::CRITICAL, $bubble = true)
|
||||
public function __construct($token, $user, $title = 'Monolog', $level = Logger::CRITICAL, $bubble = true)
|
||||
{
|
||||
parent::__construct('api.pushover.net', $level, $bubble);
|
||||
$this->conntectionPort = 80;
|
||||
$this->connectionPort = 80;
|
||||
|
||||
$this->token = $token;
|
||||
$this->user = $user;
|
||||
@@ -65,7 +65,7 @@ class PushoverHandler extends SocketHandler
|
||||
|
||||
return http_build_query($dataArray);
|
||||
}
|
||||
|
||||
|
||||
private function buildHeaderAndAddContent($content)
|
||||
{
|
||||
$header = "POST /1/messages.json HTTP/1.1\r\n";
|
||||
|
@@ -22,7 +22,7 @@ use Monolog\Logger;
|
||||
class SocketHandler extends AbstractProcessingHandler
|
||||
{
|
||||
private $connectionString;
|
||||
protected $conntectionPort = -1;
|
||||
protected $connectionPort = -1;
|
||||
private $connectionTimeout;
|
||||
private $resource;
|
||||
private $timeout = 0;
|
||||
@@ -172,7 +172,7 @@ class SocketHandler extends AbstractProcessingHandler
|
||||
*/
|
||||
protected function pfsockopen()
|
||||
{
|
||||
return @pfsockopen($this->connectionString, $this->conntectionPort, $this->errno, $this->errstr, $this->connectionTimeout);
|
||||
return @pfsockopen($this->connectionString, $this->connectionPort, $this->errno, $this->errstr, $this->connectionTimeout);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -180,7 +180,7 @@ class SocketHandler extends AbstractProcessingHandler
|
||||
*/
|
||||
protected function fsockopen()
|
||||
{
|
||||
return @fsockopen($this->connectionString, $this->conntectionPort, $this->errno, $this->errstr, $this->connectionTimeout);
|
||||
return @fsockopen($this->connectionString, $this->connectionPort, $this->errno, $this->errstr, $this->connectionTimeout);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -43,7 +43,7 @@ class PushoverHandlerTest extends TestCase
|
||||
*/
|
||||
public function testWriteContent($content)
|
||||
{
|
||||
$this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog\+error×tamp=\d{10}$/', $content);
|
||||
$this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog×tamp=\d{10}$/', $content);
|
||||
}
|
||||
|
||||
public function testWriteWithComplexTitle()
|
||||
@@ -74,7 +74,7 @@ class PushoverHandlerTest extends TestCase
|
||||
fseek($this->res, 0);
|
||||
$content = fread($this->res, 1024);
|
||||
|
||||
$expectedMessage = substr($message, 0, 499);
|
||||
$expectedMessage = substr($message, 0, 505);
|
||||
|
||||
$this->assertRegexp('/message=' . $expectedMessage . '&title/', $content);
|
||||
}
|
||||
|
Reference in New Issue
Block a user