1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-12 08:04:02 +02:00

Remove HipChat API v1 support

This commit is contained in:
Jordi Boggiano
2016-05-20 20:24:02 +01:00
parent c04d39d10b
commit cb479a9b18
2 changed files with 8 additions and 83 deletions

View File

@@ -24,30 +24,6 @@ class HipChatHandlerTest extends TestCase
/** @var HipChatHandler */
private $handler;
public function testWriteHeader()
{
$this->createHandler();
$this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
fseek($this->res, 0);
$content = fread($this->res, 1024);
$this->assertRegexp('/POST \/v1\/rooms\/message\?format=json&auth_token=.* HTTP\/1.1\\r\\nHost: api.hipchat.com\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content);
return $content;
}
public function testWriteCustomHostHeader()
{
$this->createHandler('myToken', 'room1', 'Monolog', true, 'hipchat.foo.bar');
$this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
fseek($this->res, 0);
$content = fread($this->res, 1024);
$this->assertRegexp('/POST \/v1\/rooms\/message\?format=json&auth_token=.* HTTP\/1.1\\r\\nHost: hipchat.foo.bar\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content);
return $content;
}
public function testWriteV2()
{
$this->createHandler('myToken', 'room1', 'Monolog', false, 'hipchat.foo.bar', 'v2');
@@ -92,18 +68,6 @@ class HipChatHandlerTest extends TestCase
$this->assertRegexp('/notify=0&message=test1&message_format=text&color=red&room_id=room1&from=Monolog$/', $content);
}
public function testWriteContentV1WithoutName()
{
$this->createHandler('myToken', 'room1', null, false, 'hipchat.foo.bar', 'v1');
$this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
fseek($this->res, 0);
$content = fread($this->res, 1024);
$this->assertRegexp('/notify=0&message=test1&message_format=text&color=red&room_id=room1&from=$/', $content);
return $content;
}
/**
* @depends testWriteCustomHostHeader
*/
@@ -263,14 +227,6 @@ class HipChatHandlerTest extends TestCase
$this->handler->setFormatter($this->getIdentityFormatter());
}
/**
* @expectedException InvalidArgumentException
*/
public function testCreateWithTooLongName()
{
$hipChatHandler = new HipChatHandler('token', 'room', 'SixteenCharsHere');
}
public function testCreateWithTooLongNameV2()
{
// creating a handler with too long of a name but using the v2 api doesn't matter.