Beispiel #1
0
 public function testIterator()
 {
     $stream = new Stream();
     for ($i = 0; $i < 10; $i++) {
         $status = new Status();
         $status->setText($i);
         $stream->addStatus($status);
     }
     foreach ($stream as $k => $status) {
         $this->assertInstanceOf('Lyrixx\\Lifestream\\Status', $status);
         $this->assertSame($k, $status->getText());
     }
 }
Beispiel #2
0
 /**
  * @dataProvider getFormatTests
  */
 public function testFormat($expected, $text)
 {
     $status = new Status();
     $status->setText($text);
     $this->assertSame($expected, $this->formatter->format($status)->getText());
 }
Beispiel #3
0
 /**
  * @dataProvider getFilterTests
  */
 public function testFilter($expected, $text)
 {
     $status = new Status();
     $status->setText($text);
     $this->assertSame($expected, $this->filter->isValid($status));
 }