diff --git a/lib/TraackrApi/Posts.php b/lib/TraackrApi/Posts.php index 0c06d60..8f7953e 100644 --- a/lib/TraackrApi/Posts.php +++ b/lib/TraackrApi/Posts.php @@ -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']; diff --git a/test/Posts/PostsTest.php b/test/Posts/PostsTest.php index b6be6e5..81ee6a6 100644 --- a/test/Posts/PostsTest.php +++ b/test/Posts/PostsTest.php @@ -38,16 +38,17 @@ public function testLookup() { } // End function testLookup() /** - * If keyword_aggregation is enable, keyword_matches must be set to true + * Having a false keyword match param, should still return + * valid results, even with keyword aggregation turned on * @group read only - * @expectedException Traackr\MissingParameterException */ - public function testSearchInvalidParameter() { - Traackr\Posts::search(array( + public function testSearchWithKeywordAggregations() { + $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'); } /**