/** * @covers {className}::{origMethodName} * @todo Implement testSerialize(). */ public function testSerialize() { $dto = new BandDto(); $dto->id = 100500; $dto->name = "abc"; $dto->foundDate = ViewHelper::formatDate(new \DateTime()); $dto->endDate = array($dto, 'date', 'other date'); $json = $this->object->serialize($dto); $deser = $this->object->deserialize($json); $this->assertTrue($deser instanceof BandDto); $this->assertEquals($dto->id, $deser->id); $this->assertTrue($deser->endDate[0] instanceof BandDto); $this->assertEquals($dto->id, $deser->endDate[0]->id); }
/** * Populates the specified user album with values from the specified dto. * @param \MetaPlayer\Model\UserAlbum $userAlbum * @param AlbumDto $dto */ public function populateUserAlbumWithDto(UserAlbum $userAlbum, AlbumDto $dto) { $userAlbum->setTitle($this->trimText($dto->title)); $userAlbum->setReleaseDate(ViewHelper::parseDate($dto->releaseDate)); $userAlbum->setSource($dto->source); }
/** * Populates the specified user band with values from the specified dto. * * @param \MetaPlayer\Model\UserBand $userBand * @param BandDto $dto */ public function populateUserBandWithDto(UserBand $userBand, BandDto $dto) { $userBand->setName($this->trimText($dto->name)); $userBand->setFoundDate(ViewHelper::parseDate($dto->foundDate)); $userBand->setEndDate(ViewHelper::parseDate($dto->endDate)); $userBand->setSource($dto->source); }