public function test_toFromArray()
 {
     $mockUrl = "mock";
     $mockMessage = "mockMessage";
     $mockCall = "mockCall";
     $mockCaption = "mockCaption";
     $mockLandingPage = "mockLandingPage";
     $mockVariationId = 432;
     $creative = new Creative();
     $creative->setMediaUrl($mockUrl);
     $creative->setMessage($mockMessage);
     $creative->setCallToAction($mockCall);
     $creative->setCaption($mockCaption);
     $creative->setLandingPage($mockLandingPage);
     $creative->setVariationId($mockVariationId);
     $array = $creative->toAssociativeArray();
     $this->assertEquals($mockCall, $array[Creative::CALL_TO_ACTION]);
     $creative = Creative::fromAssociativeArray($array);
     $this->assertEquals($mockUrl, $creative->getMediaUrl());
     $this->assertEquals($mockMessage, $creative->getMessage());
     $this->assertEquals($mockCall, $creative->getCallToAction());
     $this->assertEquals($mockCaption, $creative->getCaption());
     $this->assertEquals($mockLandingPage, $creative->getLandingPage());
     $this->assertEquals($mockVariationId, $creative->getVariationId());
 }
 private static function getCreativeFromBlobArray($array)
 {
     $creativeArray = null;
     if (isset($array[self::CREATIVES])) {
         $creatives = $array[self::CREATIVES];
         if (is_array($creatives)) {
             foreach ($creatives as $creative) {
                 if (is_array($creative)) {
                     $creativeArray[] = Creative::fromAssociativeArray($creative);
                 }
             }
             return $creativeArray;
         }
     }
     //support version 1
     if (isset($array[self::CREATIVE])) {
         $creative = Creative::fromAssociativeArray($array[self::CREATIVE]);
         $creativeArray = [$creative];
     }
     return $creativeArray;
 }