Add webhook event && fix tests

This commit is contained in:
Nicolas Le Goff
2014-09-08 17:50:20 +02:00
parent 98cf87557b
commit ec4d2c364f
2 changed files with 13 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ namespace Alchemy\Phrasea\Core\Event\Subscriber;
use Alchemy\Phrasea\Core\Event\FeedEntryEvent; use Alchemy\Phrasea\Core\Event\FeedEntryEvent;
use Alchemy\Phrasea\Core\PhraseaEvents; use Alchemy\Phrasea\Core\PhraseaEvents;
use Alchemy\Phrasea\Model\Entities\WebhookEvent;
use Alchemy\Phrasea\Notification\Receiver; use Alchemy\Phrasea\Notification\Receiver;
use Alchemy\Phrasea\Notification\Mail\MailInfoNewPublication; use Alchemy\Phrasea\Notification\Mail\MailInfoNewPublication;
@@ -27,6 +28,12 @@ class FeedEntrySubscriber extends AbstractNotificationSubscriber
'notify_email' => $event->hasEmailNotification(), 'notify_email' => $event->hasEmailNotification(),
]; ];
$this->app['manipulator.webhook-event']->create(
WebhookEvent::NEW_FEED_ENTRY,
WebhookEvent::FEED_ENTRY_TYPE,
array_merge(array('feed_id' => $entry->getFeed()->getId()), $params)
);
$datas = json_encode($params); $datas = json_encode($params);
$Query = new \User_Query($this->app); $Query = new \User_Query($this->app);

View File

@@ -274,6 +274,12 @@ class ACLTest extends \PhraseanetAuthenticatedTestCase
return $collection->get_base_id(); return $collection->get_base_id();
}, $acl->get_order_master_collections())); }, $acl->get_order_master_collections()));
$this->assertEquals(0, count($tbas)); $this->assertEquals(0, count($tbas));
foreach ($appbox->get_databoxes() as $databox) {
foreach ($databox->get_collections() as $collection) {
$acl->set_order_master($collection, true);
}
}
} }
public function testIs_restricted_download() public function testIs_restricted_download()