public function testCrudAccess() { $prediction = new ReachFrequencyPrediction(null, $this->getActId()); $targeting = array('geo_locations' => array('countries' => array('US')), 'age_max' => 35, 'age_min' => 20, 'genders' => array('2'), 'page_types' => array('feed')); $prediction->setData(array(RF::BURGET => 3000000, RF::TARGET_SPECS => array($targeting), RF::START_TIME => strtotime('midnight + 2 weeks'), RF::END_TIME => strtotime('midnight + 3 weeks'), RF::FREQUENCY_CAP => 4, RF::DESTINATION_ID => $this->getPageId(), RF::PREDICTION_MODE => ReachFrequencyPrediction::PREDICTION_MODE_REACH, RF::OBJECTIVE => AdObjectives::POST_ENGAGEMENT)); $this->assertCanCreate($prediction); $this->assertCanDelete($prediction); }
public function testCrudAccess() { $prediction = new ReachFrequencyPrediction(null, $this->getConfig()->accountId); $targeting = new TargetingSpecs(); $targeting->{TargetingSpecsFields::GEO_LOCATIONS} = array('countries' => array('US')); $targeting->{TargetingSpecsFields::AGE_MAX} = 35; $targeting->{TargetingSpecsFields::AGE_MIN} = 20; $targeting->{TargetingSpecsFields::GENDERS} = array(2); $targeting->{TargetingSpecsFields::PAGE_TYPES} = array(PageTypes::DESKTOP_FEED); $prediction->setData(array(RF::BUDGET => 3000000, RF::TARGET_SPEC => $targeting, RF::START_TIME => strtotime('midnight + 2 weeks'), RF::END_TIME => strtotime('midnight + 3 weeks'), RF::FREQUENCY_CAP => 4, RF::DESTINATION_ID => $this->getConfig()->pageId, RF::PREDICTION_MODE => ReachFrequencyPrediction::PREDICTION_MODE_REACH, RF::OBJECTIVE => AdObjectives::POST_ENGAGEMENT, RF::STORY_EVENT_TYPE => 128)); $this->assertCanCreate($prediction); $this->assertCanDelete($prediction); }