Esempio n. 1
0
 public function testPicsInSeries()
 {
     $url = realpath(__DIR__ . '/../Resources') . DIRECTORY_SEPARATOR . 'logo.png';
     $pic = new Pic();
     $pic->setUrl($url);
     $series = new Series();
     $pic1 = new Pic();
     $pic2 = new Pic();
     $this->assertEquals(0, count($series->getPics()));
     $series->addPic($pic);
     $this->assertEquals(1, count($series->getPics()));
     $this->assertTrue($series->containsPic($pic));
     $series->removePic($pic);
     $this->assertEquals(0, count($series->getPics()));
     $this->assertFalse($series->containsPic($pic));
     $picWithoutUrl = new Pic();
     $series->addPic($picWithoutUrl);
     $series->addPic($pic);
     $this->assertEquals(2, count($series->getPics()));
     $this->assertEquals($url, $series->getFirstUrlPic());
 }