Ejemplo n.º 1
0
 public function testAdd()
 {
     $stream = $this->getStreamMock();
     $collection = new StreamCollection();
     $this->assertEquals(array(), $collection->all());
     $collection->add($stream);
     $this->assertEquals(array($stream), $collection->all());
     $collection->add($stream);
     $this->assertEquals(array($stream, $stream), $collection->all());
 }
Ejemplo n.º 2
0
 private function mapStreams($data)
 {
     $streams = new StreamCollection();
     foreach ($data['streams'] as $properties) {
         $streams->add(new Stream($properties));
     }
     return $streams;
 }