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

Merge pull request #880 from siwinski/pr-fix-test-for-sentry-gte-0-16-0

Fix tests for sentry/sentry >= 0.16.0 (and < 1.0)
This commit is contained in:
Jordi Boggiano
2016-11-13 19:50:22 +01:00
committed by GitHub
2 changed files with 34 additions and 2 deletions

View File

@@ -0,0 +1,27 @@
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Raven_Client;
class MockRavenClient extends Raven_Client
{
public function capture($data, $stack = null, $vars = null)
{
$data = array_merge($this->get_user_data(), $data);
$this->lastData = $data;
$this->lastStack = $stack;
}
public $lastData;
public $lastStack;
}

View File

@@ -14,16 +14,21 @@ namespace Monolog\Handler;
use Monolog\Test\TestCase;
use Monolog\Logger;
use Monolog\Formatter\LineFormatter;
use Raven_Client;
class RavenHandlerTest extends TestCase
{
public function setUp()
{
if (!class_exists('Raven_Client')) {
$this->markTestSkipped('raven/raven not installed');
$this->markTestSkipped('sentry/sentry not installed');
}
require_once __DIR__ . '/MockRavenClient.php';
if (version_compare(Raven_Client::VERSION, '0.16.0', '>=')) {
require_once __DIR__ . '/MockRavenClient-gte-0-16-0.php';
} else {
require_once __DIR__ . '/MockRavenClient.php';
}
}
/**