Skip to content

Commit

Permalink
#35 Removed validation for requiring keyword_matches flag to be true
Browse files Browse the repository at this point in the history
  • Loading branch information
KidA78 committed Jul 21, 2016
1 parent 71f965d commit 9cada13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 0 additions & 5 deletions lib/TraackrApi/Posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ public static function search($p = array(
$p['include_brand_content'] = $posts->convertBool($p, 'include_brand_content');
$p['include_shared_content'] = $posts->convertBool($p, 'include_shared_content');

// Validate business requirements
if ( $p['enable_keyword_aggregation'] === 'true' && $p['include_keyword_matches'] === 'false' ) {
throw new MissingParameterException("'include_keyword_matches' needs to be set to true for 'keyword_aggregation' to work");
}

// support for multi params
$p['keywords'] = is_array($p['keywords']) ?
implode(',', $p['keywords']) : $p['keywords'];
Expand Down
3 changes: 2 additions & 1 deletion test/Posts/PostsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ public function testLookup() {
* @expectedException Traackr\MissingParameterException
*/
public function testSearchInvalidParameter() {
Traackr\Posts::search(array(
$posts = Traackr\Posts::search(array(
'keywords' => array('traackr', '"content marketing"'),
'include_keyword_matches' => false,
'enable_keyword_aggregation' => true
));
$this->assertGreaterThan(0, $posts['posts'], 'No results found');
}

/**
Expand Down

0 comments on commit 9cada13

Please sign in to comment.