public function testDeliveryFailure()
 {
     $manipApp = new ApiApplicationManipulator(self::$DI['app']['orm.em'], self::$DI['app']['repo.api-applications'], self::$DI['app']['random.medium']);
     $application = $manipApp->create(uniqid('app'), ApiApplication::WEB_TYPE, 'Desktop application description', 'http://web-app-url.net', self::$DI['user'], 'http://web-app-url.net/callback');
     $manipulator = new WebhookEventDeliveryManipulator(self::$DI['app']['orm.em'], self::$DI['app']['repo.webhook-delivery']);
     $eventDelivery = $manipulator->create($application, self::$DI['webhook-event']);
     $tries = $eventDelivery->getDeliveryTries();
     $manipulator->deliveryFailure($eventDelivery);
     $this->assertfalse($eventDelivery->isDelivered());
     $this->assertGreaterThan($tries, $eventDelivery->getDeliveryTries());
 }
 public function testSetWebsiteUrl()
 {
     $manipulator = new ApiApplicationManipulator(self::$DI['app']['orm.em'], self::$DI['app']['repo.api-applications'], self::$DI['app']['random.medium']);
     $application = $manipulator->create('desktop-app6', ApiApplication::DESKTOP_TYPE, 'Desktop application description', 'http://desktop-app6-url.net');
     try {
         $manipulator->setWebsiteUrl($application, 'invalid-url.com');
         $this->fail('Invalid argument exception should be raised');
     } catch (InvalidArgumentException $e) {
     }
 }