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()); }
private function mapStreams($data) { $streams = new StreamCollection(); foreach ($data['streams'] as $properties) { $streams->add(new Stream($properties)); } return $streams; }