Skip to content

Commit cd8361a

Browse files
author
Luca Bruno
committed
Implement PageTypes Enum
Summary: Split page_types into an array of single items Test Plan: NP
1 parent 239d024 commit cd8361a

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* Copyright 2014 Facebook, Inc.
4+
*
5+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
6+
* use, copy, modify, and distribute this software in source code or binary
7+
* form for use in connection with the web services and APIs provided by
8+
* Facebook.
9+
*
10+
* As with any software that integrates with the Facebook platform, your use
11+
* of this software is subject to the Facebook Developer Principles and
12+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
13+
* shall be included in all copies or substantial portions of the software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21+
* DEALINGS IN THE SOFTWARE.
22+
*
23+
*/
24+
25+
namespace FacebookAds\Object\Values;
26+
27+
use FacebookAds\Enum\AbstractEnum;
28+
29+
/**
30+
* @method static PageTypes getInstance()
31+
*/
32+
class PageTypes extends AbstractEnum {
33+
34+
const DESKTOP_FEED = 'desktopfeed';
35+
const HOME = 'home';
36+
const LEGACY_EXTERNAL = 'legacyexternal';
37+
const LOGOUT = 'logout';
38+
const MOBILE_EXTERNAL = 'mobileexternal';
39+
const MOBILE_FEED = 'mobilefeed';
40+
const RIGHT_COLUMN = 'rightcolumn';
41+
}

test/FacebookAdsTest/Object/ReachFrequencyPredictionTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use FacebookAds\Object\Fields\ReachFrequencyPredictionFields as RF;
3030
use FacebookAds\Object\TargetingSpecs;
3131
use FacebookAds\Object\Values\AdObjectives;
32+
use FacebookAds\Object\Values\PageTypes;
3233
use FacebookAdsTest\Config\SkippableFeatureTestInterface;
3334

3435
class ReachFrequencyPredictionTest extends AbstractCrudObjectTestCase
@@ -52,8 +53,9 @@ public function testCrudAccess() {
5253
$targeting->{TargetingSpecsFields::AGE_MAX} = 35;
5354
$targeting->{TargetingSpecsFields::AGE_MIN} = 20;
5455
$targeting->{TargetingSpecsFields::GENDERS} = array(2);
55-
$targeting->{TargetingSpecsFields::PAGE_TYPES} = array('desktopfeed');
56-
56+
$targeting->{TargetingSpecsFields::PAGE_TYPES} = array(
57+
PageTypes::DESKTOP_FEED,
58+
);
5759

5860
$prediction->setData(array(
5961
RF::BUDGET => 3000000,

0 commit comments

Comments
 (0)