1
0
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:
Sebastian Goettschkes
2012-10-05 16:56:58 +02:00
parent 11c07edfbe
commit cb675ae10f
3 changed files with 8 additions and 8 deletions

View File

@@ -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";

View File

@@ -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);
}
/**

View File

@@ -43,7 +43,7 @@ class PushoverHandlerTest extends TestCase
*/
public function testWriteContent($content)
{
$this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog\+error&timestamp=\d{10}$/', $content);
$this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog&timestamp=\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);
}