Permalink
Browse files

Pull in mlehner/gelf-php via Composer

  • Loading branch information...
1 parent c9e6175 commit 14ac76a0aefee79dfd4a9045f594a731a959c8bb @msabramo msabramo committed Apr 6, 2012
Showing with 35 additions and 4 deletions.
  1. +2 −0 .gitignore
  2. +9 −1 composer.json
  3. +11 −0 composer.lock
  4. +12 −3 tests/Monolog/Handler/GelfHandlerTest.php
  5. +1 −0 tests/bootstrap.php
View
2 .gitignore
@@ -1 +1,3 @@
+vendor
+composer.phar
phpunit.xml
View
10 composer.json
@@ -19,10 +19,18 @@
{
"type": "vcs",
"url": "https://github.com/mlehner/gelf-php"
+ },
+ {
+ "type": "vcs",
+ "url": "https://github.com/msabramo/gelf-php-1"
+ },
+ {
+ "type": "vcs",
+ "url": "https://github.com/msabramo/gelf-php"
}
],
"suggest": {
- "gelf-php": ">=0"
+ "mlehner/gelf-php": "dev-add-composer-support"
},
"autoload": {
"psr-0": {"Monolog": "src/"}
View
11 composer.lock
@@ -0,0 +1,11 @@
+{
+ "hash": "5715c4c52bc66b23002954fb3a2f47e4",
+ "packages": [
+ {
+ "package": "mlehner/gelf-php",
+ "version": "dev-add-composer-support",
+ "source-reference": "39419c2b75daf6b9eb9feb6ac0541807ee888cda"
+ }
+ ],
+ "aliases": []
+}
View
15 tests/Monolog/Handler/GelfHandlerTest.php
@@ -11,14 +11,15 @@
namespace Monolog\Handler;
+use Monolog\TestCase;
use Monolog\Logger;
use Gelf\MessagePublisher;
-class GelfHandlerTest extends \PHPUnit_Framework_TestCase
+class GelfHandlerTest extends TestCase
{
public function setUp()
{
- if (!class_exists("MessagePublisher"))
+ if (!class_exists("Gelf\MessagePublisher"))
{
$this->markTestSkipped("https://github.com/mlehner/gelf-php not installed");
}
@@ -35,6 +36,14 @@ public function testConstruct()
protected function getMessagePublisher()
{
- return new MessagePublisher();
+ return new MessagePublisher('localhost');
+ }
+
+ public function testStuff()
+ {
+ $handler = new GelfHandler($this->getMessagePublisher());
+ $handler->setFormatter($this->getIdentityFormatter());
+ $handler->handle($this->getRecord(Logger::DEBUG));
+ $handler->handle($this->getRecord(Logger::WARNING));
}
}
View
1 tests/bootstrap.php
@@ -9,6 +9,7 @@
* file that was distributed with this source code.
*/
+require_once __DIR__ . "/../vendor/.composer/autoload.php";
require_once __DIR__.'/Monolog/TestCase.php';
spl_autoload_register(function($class)

0 comments on commit 14ac76a

Please sign in to comment.