/**
  * {@inheritdoc}
  */
 public function collect(Request $request, Response $response, \Exception $exception = null)
 {
     $this->data['subscribeAttempts'] = $this->logger->getSubscribeAttempts();
     $this->data['subscribeAttemptCount'] = $this->logger->countSubscribeAttempts();
     $this->data['unsubscribeAttempts'] = $this->logger->getUnsubscribeAttempts();
     $this->data['unsubscribeAttemptCount'] = $this->logger->countUnsubscribeAttempts();
 }
 public function testUnsuccessfulSubscribeAttemptLogged()
 {
     $logger = $this->getMock('Symfony\\Component\\HttpKernel\\Log\\LoggerInterface');
     $subscriptionLogger = new SubscriptionLogger($logger);
     $logger->expects($this->once())->method('warn');
     $subscriptionLogger->logSubscribeAttempt(false, array('http://www.google.com'), true);
     $this->assertEquals(1, $subscriptionLogger->countSubscribeAttempts(), 'Incorrect number of attempts logged');
     $attempts = $subscriptionLogger->getSubscribeAttempts();
     $this->assertFalse($attempts[0]->successful, 'Attempt expected to be unsuccessful');
     $this->assertEquals(array('http://www.google.com'), $attempts[0]->urls, 'Incorrect URLs stored for attempt');
     $this->assertTrue($attempts[0]->digest, 'Attempt expected to be digest subscription');
 }