Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php use Mockery as m; use Monolog\Logger; use Logentries\Handler\LogentriesHandler; c..
Decoded Output download
<?php
use Mockery as m;
use Monolog\Logger;
use Logentries\Handler\LogentriesHandler;
class LogentriesHandlerTest extends \PHPUnit_Framework_TestCase
{
private $log;
private $socketMock;
public function setUp()
{
$this->socketMock = m::mock('Logentries\Socket');
$this->log = new Logger('TestLog');
$this->log->pushHandler(new LogentriesHandler('testToken', Logger::DEBUG, true, $this->socketMock));
}
public function tearDown()
{
m::close();
}
public function testWarning()
{
$this->socketMock->shouldReceive('write')
->once()
->with('/testToken\s\[(\d){4}-(\d){2}-(\d){2}\s(\d){2}:(\d){2}:(\d){2}\]\sTestLog.WARNING:\sFoo\s\[\]\s\[\]/');
$this->log->addWarning('Foo');
}
} ?>
Did this file decode correctly?
Original Code
<?php
use Mockery as m;
use Monolog\Logger;
use Logentries\Handler\LogentriesHandler;
class LogentriesHandlerTest extends \PHPUnit_Framework_TestCase
{
private $log;
private $socketMock;
public function setUp()
{
$this->socketMock = m::mock('Logentries\Socket');
$this->log = new Logger('TestLog');
$this->log->pushHandler(new LogentriesHandler('testToken', Logger::DEBUG, true, $this->socketMock));
}
public function tearDown()
{
m::close();
}
public function testWarning()
{
$this->socketMock->shouldReceive('write')
->once()
->with('/testToken\s\[(\d){4}-(\d){2}-(\d){2}\s(\d){2}:(\d){2}:(\d){2}\]\sTestLog.WARNING:\sFoo\s\[\]\s\[\]/');
$this->log->addWarning('Foo');
}
}
Function Calls
| None |
Stats
| MD5 | 1ba217b0b83d09269d6fafe54a26809b |
| Eval Count | 0 |
| Decode Time | 86 ms |