Skip to content

Commit

Permalink
[fixes] failed in HHVM (again)
Browse files Browse the repository at this point in the history
Signed-off-by: Fery Wardiyanto <ferywardiyanto@gmail.com>
  • Loading branch information
feryardiant committed Dec 7, 2015
1 parent f594c64 commit fd67db4
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions tests/MonologTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ public function testConstructorUsingSyslogHandler()
$this->settings['basename'],
$this->settings['logger']
]);

$mock->getMethod('useSyslog')->invoke($monolog);
$log = $mock->getMethod('getMonolog')->invoke($monolog);
$handler = $log->getHandlers();

$this->assertInstanceOf(Handler\SyslogHandler::class, array_shift($handler));
}

public function testConstructorUsingRotatingFilesHandler()
Expand Down Expand Up @@ -133,6 +127,22 @@ public function testConstructorUsingRotatingFilesHandler()
]);
}

public function testUsingSyslogHandler()
{
$this->settings['logger']['directory'] = 'syslog';

// Create new Projek\Slim\Monolog::__construct() instance
$mock = (new ReflectionClass(Monolog::class))->newInstanceArgs([
$this->settings['basename'],
$this->settings['logger']
]);

// Expect instance of registered handler
$handler = $mock->getMonolog()->getHandlers();
$this->assertCount(1, $handler);
$this->assertInstanceOf(Handler\SyslogHandler::class, array_shift($handler));
}

public function testUsingRotatingFilesHandler()
{
// Create new Projek\Slim\Monolog::__construct() instance
Expand Down

0 comments on commit fd67db4

Please sign in to comment.