/**
  * @dataProvider statusProvider
  */
 public function testStatus($counts, $expectedStatus, $message)
 {
     $modelManager = $this->getMock('Sonata\\NotificationBundle\\Model\\MessageManagerInterface');
     $modelManager->expects($this->exactly(1))->method('countStates')->will($this->returnValue($counts));
     $backend = new MessageManagerBackend($modelManager, array(MessageInterface::STATE_IN_PROGRESS => 10, MessageInterface::STATE_ERROR => 30, MessageInterface::STATE_OPEN => 100, MessageInterface::STATE_DONE => 10000));
     $status = $backend->getStatus();
     $this->assertInstanceOf('Sonata\\NotificationBundle\\Backend\\BackendStatus', $status);
     $this->assertEquals($expectedStatus, $status->getStatus());
     $this->assertEquals($message, $status->getMessage());
 }
 /**
  * @dataProvider statusProvider
  */
 public function testStatus($counts, $expectedStatus, $message)
 {
     if (!class_exists('ZendDiagnostics\\Result\\Success')) {
         $this->markTestSkipped('The class ZendDiagnostics\\Result\\Success does not exist');
     }
     $modelManager = $this->getMock('Sonata\\NotificationBundle\\Model\\MessageManagerInterface');
     $modelManager->expects($this->exactly(1))->method('countStates')->will($this->returnValue($counts));
     $backend = new MessageManagerBackend($modelManager, array(MessageInterface::STATE_IN_PROGRESS => 10, MessageInterface::STATE_ERROR => 30, MessageInterface::STATE_OPEN => 100, MessageInterface::STATE_DONE => 10000));
     $status = $backend->getStatus();
     $this->assertInstanceOf(get_class($expectedStatus), $status);
     $this->assertEquals($message, $status->getMessage());
 }
 /**
  * {@inheritdoc}
  */
 public function getIterator()
 {
     return $this->iterator == null ? parent::getIterator() : $this->iterator;
 }