Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test file includes and missing config added
- Loading branch information
Kemal Yenilmez
committed
Jul 18, 2016
1 parent
65051e7
commit 941f311
Showing
4 changed files
with
53 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
syntaxCheck="false" | ||
> | ||
<testsuites> | ||
<testsuite name="Package Test Suite"> | ||
<directory suffix=".php">./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use Mockery as m; | ||
use Monolog\Logger; | ||
|
||
|
||
class GlogTest extends TestCase | ||
{ | ||
|
||
public function testWrite() | ||
{ | ||
$record = $this->getRecord(Logger::WARNING, 'log', array('data' => new \stdClass, 'foo' => 34)); | ||
$handler = new Gazatem\Glog\Glog(); | ||
try{ | ||
$handler->handle($record); | ||
}catch (\RuntimeException $e){ | ||
$this->markTestSkipped('Log failed!'); | ||
} | ||
} | ||
|
||
protected function getRecord($level = Logger::WARNING, $message = 'test', $context = array()) | ||
{ | ||
return array( | ||
'message' => $message, | ||
'context' => $context, | ||
'level' => $level, | ||
'level_name' => Logger::getLevelName($level), | ||
'channel' => 'test', | ||
'datetime' => \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true))), | ||
'extra' => array(), | ||
); | ||
} | ||
} |