1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-04 04:07:39 +02:00

Remove old SocketTest. Fix CS issues

This commit is contained in:
Pablo Belloc
2012-02-26 14:17:19 -03:00
parent cc9c02250c
commit 722cabc535
5 changed files with 92 additions and 93 deletions

View File

@@ -15,7 +15,6 @@ use Monolog\Logger;
use Monolog\Handler\SocketHandler\Exception\ConnectionException;
use Monolog\Handler\SocketHandler\Exception\WriteToSocketException;
/**
* Stores to any socket - uses fsockopen() or pfsockopen().
*
@@ -24,6 +23,7 @@ use Monolog\Handler\SocketHandler\Exception\WriteToSocketException;
*/
class SocketHandler extends AbstractProcessingHandler
{
private $connectionString;
private $connectionTimeout;
private $resource;
@@ -123,11 +123,13 @@ class SocketHandler extends AbstractProcessingHandler
return $this->persistent;
}
public function getConnectionTimeout() {
public function getConnectionTimeout()
{
return $this->connectionTimeout;
}
public function getTimeout() {
public function getTimeout()
{
return $this->timeout;
}
@@ -228,4 +230,5 @@ class SocketHandler extends AbstractProcessingHandler
{
return stream_get_meta_data($this->resource);
}
}

View File

@@ -13,4 +13,5 @@ namespace Monolog\Handler\SocketHandler\Exception;
class ConnectionException extends \RuntimeException
{
}

View File

@@ -13,4 +13,5 @@ namespace Monolog\Handler\SocketHandler\Exception;
class WriteToSocketException extends \RuntimeException
{
}

View File

@@ -1,8 +0,0 @@
<?php
namespace Monolog\Handler\SocketHandler;
class SocketTest extends \PHPUnit_Framework_TestCase
{
}

View File

@@ -21,6 +21,7 @@ use Monolog\Handler\SocketHandler\Exception\WriteToSocketException;
*/
class SocketHandlerTest extends TestCase
{
/**
* @var Monolog\Handler\SocketHandler
*/
@@ -34,7 +35,8 @@ class SocketHandlerTest extends TestCase
/**
* @expectedException Monolog\Handler\SocketHandler\Exception\ConnectionException
*/
public function testInvalidHostname() {
public function testInvalidHostname()
{
$this->createHandler('garbage://here');
$this->writeRecord('data');
}
@@ -85,6 +87,7 @@ class SocketHandlerTest extends TestCase
$this->writeRecord($string);
$this->fail("Shoul not connect - are you running a server on 127.0.0.1:7894 ?");
} catch (\Monolog\Handler\SocketHandler\Exception\ConnectionException $e) {
}
}
@@ -251,10 +254,9 @@ class SocketHandlerTest extends TestCase
private function setMockHandler(array $methods)
{
$this->handler = $this->getMock(
'\Monolog\Handler\SocketHandler',
$methods,
array('localhost:1234')
'\Monolog\Handler\SocketHandler', $methods, array('localhost:1234')
);
$this->handler->setFormatter($this->getIdentityFormatter());
}
}