mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
Add api webhook adapter
This commit is contained in:
23
tests/classes/api/api_webhookTest.php
Normal file
23
tests/classes/api/api_webhookTest.php
Normal 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) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user