Add api webhook adapter

This commit is contained in:
Nicolas Le Goff
2014-03-16 04:35:26 +01:00
parent bcc9745588
commit b23115d38d
2 changed files with 117 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<?php
use Alchemy\Phrasea\Exception\RuntimeException;
class API_WebhookTest extends PhraseanetPHPUnitAbstract
{
public function testsNewApiHook()
{
$w = \API_Webhook::create(self::$DI['app']['phraseanet.appbox'], 'new_feed', array('w1', 'salut' => 'you'));
$this->assertInstanceOf('\API_webhook', $w);
$w->delete();
}
public function testNewApiHookObjectNotFound()
{
try {
$w = new \API_Webhook(self::$DI['app']['phraseanet.appbox'], -1);
$this->fail('It should raise an exception');
} catch (RuntimeException $e) {
}
}
}