Example #1
0
 /**
  * Test if correct sub selection is returned
  *
  * @test
  * @return void
  */
 public function correctMediaSelectionIsReturned()
 {
     $imageElement1 = new Media();
     $imageElement1->setType(Media::MEDIA_TYPE_IMAGE);
     $imageElement2 = new Media();
     $imageElement2->setType(Media::MEDIA_TYPE_IMAGE);
     $imageElement3 = new Media();
     $imageElement3->setType(Media::MEDIA_TYPE_IMAGE);
     $multimediaElement1 = new Media();
     $multimediaElement1->setType(Media::MEDIA_TYPE_MULTIMEDIA);
     $news = new News();
     $news->addMedia($imageElement1);
     $news->addMedia($imageElement2);
     $news->addMedia($imageElement3);
     $news->addMedia($imageElement3);
     $news->addMedia($multimediaElement1);
     $this->assertEquals(3, count($news->getMediaTypeImage()));
     $this->assertEquals(1, count($news->getMediaTypeMultimedia()));
     $this->assertEquals(4, count($news->getMedia()));
 }